BigEndianBinaryReader
struct · ferroui-base · v0.5.0
struct BigEndianBinaryReader<'a>
Binary reader using big-endian encoding over a byte slice.
No method panics on malformed input: reading past the end gives
FontTableError::EndOfSpan.
Members
newpositionseekread_byteread_sbyteread_f2dot14read_int16read_int16_asread_fwordread_fword_arrayread_ufwordread_fixedread_version16_dot16read_int32read_int64read_uint16read_offset16read_uint16_asread_uint16_arrayread_uint16_array_intoread_uint32_arrayread_uint8_arrayread_int16_arrayread_int16_array_intoread_uint8read_uint24read_uint32read_offset32read_bytesread_stringread_tagread_offset
new
fn new(span: &'a [u8]) -> Self
Initializes a new reader over span.
position
fn position(self: &Self) -> i32
Gets the current position in the span.
seek
fn seek(self: &mut Self, offset: i32) -> Result<(), FontTableError>
Seeks within the span.
read_byte
fn read_byte(self: &mut Self) -> Result<u8, FontTableError>
read_sbyte
fn read_sbyte(self: &mut Self) -> Result<i8, FontTableError>
read_f2dot14
fn read_f2dot14(self: &mut Self) -> Result<f32, FontTableError>
read_int16
fn read_int16(self: &mut Self) -> Result<i16, FontTableError>
read_int16_as
fn read_int16_as<T: From<u16>>(self: &mut Self) -> Result<T, FontTableError>
Reads a 16 bit value and reinterprets it as T (the reference's
ReadInt16<TEnum>).
read_fword
fn read_fword(self: &mut Self) -> Result<i16, FontTableError>
read_fword_array
fn read_fword_array(self: &mut Self, length: i32) -> Result<Vec<i16>, FontTableError>
read_ufword
fn read_ufword(self: &mut Self) -> Result<u16, FontTableError>
read_fixed
fn read_fixed(self: &mut Self) -> Result<f32, FontTableError>
read_version16_dot16
fn read_version16_dot16(self: &mut Self) -> Result<FontVersion, FontTableError>
read_int32
fn read_int32(self: &mut Self) -> Result<i32, FontTableError>
read_int64
fn read_int64(self: &mut Self) -> Result<i64, FontTableError>
read_uint16
fn read_uint16(self: &mut Self) -> Result<u16, FontTableError>
read_offset16
fn read_offset16(self: &mut Self) -> Result<u16, FontTableError>
read_uint16_as
fn read_uint16_as<T: From<u16>>(self: &mut Self) -> Result<T, FontTableError>
Reads a 16 bit value and reinterprets it as T (the reference's
ReadUInt16<TEnum>).
read_uint16_array
fn read_uint16_array(self: &mut Self, length: i32) -> Result<Vec<u16>, FontTableError>
read_uint16_array_into
fn read_uint16_array_into(self: &mut Self, buffer: &mut [u16]) -> Result<(), FontTableError>
read_uint32_array
fn read_uint32_array(self: &mut Self, length: i32) -> Result<Vec<u32>, FontTableError>
read_uint8_array
fn read_uint8_array(self: &mut Self, length: i32) -> Result<Vec<u8>, FontTableError>
read_int16_array
fn read_int16_array(self: &mut Self, length: i32) -> Result<Vec<i16>, FontTableError>
read_int16_array_into
fn read_int16_array_into(self: &mut Self, buffer: &mut [i16]) -> Result<(), FontTableError>
read_uint8
fn read_uint8(self: &mut Self) -> Result<u8, FontTableError>
read_uint24
fn read_uint24(self: &mut Self) -> Result<i32, FontTableError>
read_uint32
fn read_uint32(self: &mut Self) -> Result<u32, FontTableError>
read_offset32
fn read_offset32(self: &mut Self) -> Result<u32, FontTableError>
read_bytes
fn read_bytes(self: &mut Self, count: i32) -> Vec<u8>
Reads up to count bytes, truncating at the end of the span; the
returned vector is shorter than count when fewer bytes remain.
read_string
fn read_string(self: &mut Self, bytes_to_read: i32, encoding: Encoding) -> Result<String, FontTableError>
read_tag
fn read_tag(self: &mut Self) -> Result<String, FontTableError>
read_offset
fn read_offset(self: &mut Self, size: i32) -> Result<i32, FontTableError>
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeClassDefaultsBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>AnyToOwnedErasedDestructorIntoEitherCloneDebug
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.