pub enum AutoEndianReader<R> {
Little(R),
Big(R),
}
Expand description
A reader that will store whether to read in little or big endian
Variants§
Implementations§
Source§impl<R> AutoEndianReader<R>
impl<R> AutoEndianReader<R>
Sourcepub fn new_little(inner: R) -> Self
pub fn new_little(inner: R) -> Self
Makes a new AutoEndianReader
in little endian
Source§impl<R: Utf16ReadExt> AutoEndianReader<R>
impl<R: Utf16ReadExt> AutoEndianReader<R>
Sourcepub fn new_auto_bom(inner: R) -> Result<Self, Error>
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
Sourcepub fn read_u16(&mut self) -> Result<u16, Error>
pub fn read_u16(&mut self) -> Result<u16, Error>
Mirror of Utf16ReadExt::read_u16
without the type parameter for endianness
Sourcepub fn shorts(self) -> AutoEndianShorts<R> ⓘwhere
Self: Sized,
pub fn shorts(self) -> AutoEndianShorts<R> ⓘwhere
Self: Sized,
Mirror of Utf16ReadExt::shorts
without the type parameter for endianness
Sourcepub fn utf16_chars(self) -> AutoEndianChars<R> ⓘwhere
Self: Sized,
pub fn utf16_chars(self) -> AutoEndianChars<R> ⓘwhere
Self: Sized,
Mirror of Utf16ReadExt::utf16_chars
without the type parameter for endianness
Sourcepub fn read_utf16_line(&mut self, buf: &mut String) -> Result<usize, Error>
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
Sourcepub fn utf16_lines(self) -> AutoEndianLines<R> ⓘwhere
Self: Sized,
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more