Skip to main content

StreamReader

Struct StreamReader 

Source
pub struct StreamReader<R> { /* private fields */ }

Implementations§

Source§

impl StreamReader<BufReader<File>>

Source

pub fn from_file(filename: PathBuf) -> Result<Self, Error>

Source§

impl<R: BufRead + Seek> StreamReader<R>

Source

pub fn new(reader: R) -> StreamReader<R>

Trait Implementations§

Source§

impl<R: BufRead + Seek> BinaryReader for StreamReader<R>

Source§

fn skip_ptr(&mut self, size: usize) -> Result<usize, Error>

skip size byte

Source§

fn set_endian(&mut self, endian: Endian)

Source§

fn endian(&self) -> Endian

Source§

fn read_byte(&mut self) -> Result<u8, Error>

Source§

fn read_u8(&mut self) -> Result<u8, Error>

Source§

fn read_i8(&mut self) -> Result<i8, Error>

Source§

fn read_exact(&mut self, array: &mut [u8]) -> Result<(), Error>

Source§

fn read_bytes_as_vec(&mut self, len: usize) -> Result<Vec<u8>, Error>

Source§

fn read_bytes_no_move(&mut self, len: usize) -> Result<Vec<u8>, Error>

read_bytes_no_move does not move offset after read_bytes. Read more
Source§

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

Source§

fn read_u32(&mut self) -> Result<u32, Error>

Source§

fn read_u64(&mut self) -> Result<u64, Error>

Source§

fn read_u128(&mut self) -> Result<u128, Error>

Source§

fn read_i16(&mut self) -> Result<i16, Error>

Source§

fn read_i32(&mut self) -> Result<i32, Error>

Source§

fn read_i64(&mut self) -> Result<i64, Error>

Source§

fn read_i128(&mut self) -> Result<i128, Error>

Source§

fn read_f32(&mut self) -> Result<f32, Error>

Source§

fn read_f64(&mut self) -> Result<f64, Error>

Source§

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

Source§

fn read_u32_be(&mut self) -> Result<u32, Error>

Source§

fn read_u64_be(&mut self) -> Result<u64, Error>

Source§

fn read_u128_be(&mut self) -> Result<u128, Error>

Source§

fn read_i16_be(&mut self) -> Result<i16, Error>

Source§

fn read_i32_be(&mut self) -> Result<i32, Error>

Source§

fn read_i64_be(&mut self) -> Result<i64, Error>

Source§

fn read_i128_be(&mut self) -> Result<i128, Error>

Source§

fn read_f32_be(&mut self) -> Result<f32, Error>

Source§

fn read_f64_be(&mut self) -> Result<f64, Error>

Source§

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

Source§

fn read_u32_le(&mut self) -> Result<u32, Error>

Source§

fn read_u64_le(&mut self) -> Result<u64, Error>

Source§

fn read_u128_le(&mut self) -> Result<u128, Error>

Source§

fn read_i16_le(&mut self) -> Result<i16, Error>

Source§

fn read_i32_le(&mut self) -> Result<i32, Error>

Source§

fn read_i64_le(&mut self) -> Result<i64, Error>

Source§

fn read_i128_le(&mut self) -> Result<i128, Error>

Source§

fn read_f32_le(&mut self) -> Result<f32, Error>

Source§

fn read_f64_le(&mut self) -> Result<f64, Error>

Source§

fn offset(&mut self) -> Result<u64, Error>

Source§

fn seek(&mut self, seek: SeekFrom) -> Result<u64, Error>

Source§

fn read_bytes(&mut self, array: &mut [u8]) -> Result<(), Error>

👎Deprecated since 0.0.10:

Use new function read_exact() instead

Source§

fn read_ascii_string(&mut self, size: usize) -> Result<String, Error>

read_ascii_string for C like ascii string.This function finishes find end marker 0x00. Read more
Source§

fn read_utf16_string(&mut self, size: usize) -> Result<String, Error>

0.0.11 read_utf16_string for utf16 string. use endien “size” refers to the number of bytes.
Source§

fn read_utf16be_string(&mut self, size: usize) -> Result<String, Error>

Source§

fn read_utf16le_string(&mut self, size: usize) -> Result<String, Error>

Source§

fn read_utf8_string(&mut self, size: usize) -> Result<String, Error>

Source§

impl<R: Clone> Clone for StreamReader<R>

Source§

fn clone(&self) -> StreamReader<R>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<R: Debug> Debug for StreamReader<R>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<File> for StreamReader<BufReader<File>>

Available on non-target_family=wasm only.
Source§

fn from(file: File) -> Self

Converts to this type from the input type.
Source§

impl<R> From<R> for StreamReader<Cursor<R>>
where R: Read,

Source§

fn from(reader: R) -> Self

Converts to this type from the input type.
Source§

impl<R: Copy> Copy for StreamReader<R>

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

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

§

impl<R> UnsafeUnpin for StreamReader<R>
where R: UnsafeUnpin,

§

impl<R> UnwindSafe for StreamReader<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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.