Enum AutoEndianReader

Source
pub enum AutoEndianReader<R> {
    Little(R),
    Big(R),
}
Expand description

A reader that will store whether to read in little or big endian

Variants§

§

Little(R)

Little endian reader

§

Big(R)

Big endian reader

Implementations§

Source§

impl<R> AutoEndianReader<R>

Source

pub fn new_little(inner: R) -> Self

Makes a new AutoEndianReader in little endian

Source

pub fn new_big(inner: R) -> Self

Makes a new AutoEndianReader in big endian

Source

pub fn is_little(&self) -> bool

Returns true if this reader is little endian

Source

pub fn is_big(&self) -> bool

Returns true if this reader is big endian

Source§

impl<R: Utf16ReadExt> AutoEndianReader<R>

Source

pub fn new_auto_bom(inner: R) -> Result<Self, Error>

Reads a u16 to detect the endianness

If the value isn’t a valid bom (U+FEFF), an error is thrown

Source

pub fn read_u16(&mut self) -> Result<u16, Error>

Mirror of Utf16ReadExt::read_u16 without the type parameter for endianness

Source

pub fn shorts(self) -> AutoEndianShorts<R>
where Self: Sized,

Mirror of Utf16ReadExt::shorts without the type parameter for endianness

Source

pub fn utf16_chars(self) -> AutoEndianChars<R>
where Self: Sized,

Mirror of Utf16ReadExt::utf16_chars without the type parameter for endianness

Source

pub fn read_utf16_line(&mut self, buf: &mut String) -> Result<usize, Error>

Mirror of Utf16ReadExt::read_utf16_line without the type parameter for endianness

Source

pub fn utf16_lines(self) -> AutoEndianLines<R>
where Self: Sized,

Mirror of Utf16ReadExt::utf16_lines without the type parameter for endianness

Auto Trait Implementations§

§

impl<R> Freeze for AutoEndianReader<R>
where R: Freeze,

§

impl<R> RefUnwindSafe for AutoEndianReader<R>
where R: RefUnwindSafe,

§

impl<R> Send for AutoEndianReader<R>
where R: Send,

§

impl<R> Sync for AutoEndianReader<R>
where R: Sync,

§

impl<R> Unpin for AutoEndianReader<R>
where R: Unpin,

§

impl<R> UnwindSafe for AutoEndianReader<R>
where R: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.