Struct Reader

Source
pub struct Reader<'a, I: 'a + ReadAt> { /* private fields */ }
Expand description

A reader of data from the virtual disk image.

Trait Implementations§

Source§

impl<'a, I> ReadAt for Reader<'a, I>
where I: 'a + ReadAt,

Source§

fn read_at(&self, pos: u64, buf: &mut [u8]) -> Result<usize>

Read bytes from an offset in this source into a buffer, returning how many bytes were read. Read more
Source§

fn read_exact_at(&self, pos: u64, buf: &mut [u8]) -> Result<(), Error>

Read the exact number of bytes required to fill buf, from an offset. Read more
Source§

impl<'a, I> Size for Reader<'a, I>
where I: 'a + ReadAt,

Source§

fn size(&self) -> Result<Option<u64>>

Get the size of this object, in bytes. Read more

Auto Trait Implementations§

§

impl<'a, I> Freeze for Reader<'a, I>

§

impl<'a, I> RefUnwindSafe for Reader<'a, I>
where I: RefUnwindSafe,

§

impl<'a, I> Send for Reader<'a, I>
where I: Sync,

§

impl<'a, I> Sync for Reader<'a, I>
where I: Sync,

§

impl<'a, I> Unpin for Reader<'a, I>

§

impl<'a, I> UnwindSafe for Reader<'a, I>
where I: RefUnwindSafe,

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<R> ReadBytesExt for R
where R: ReadAt,

Source§

fn read_u8_at(&self, pos: u64) -> Result<u8, Error>

Reads an unsigned 8-bit integer at an offset.
Source§

fn read_i8_at(&self, pos: u64) -> Result<i8, Error>

Reads a signed 8-bit integer at an offset.
Source§

fn read_u16_at<T>(&self, pos: u64) -> Result<u16, Error>
where T: ByteOrder,

Reads an unsigned 16-bit integer at an offset.
Source§

fn read_i16_at<T>(&self, pos: u64) -> Result<i16, Error>
where T: ByteOrder,

Reads a signed 16-bit integer at an offset.
Source§

fn read_u32_at<T>(&self, pos: u64) -> Result<u32, Error>
where T: ByteOrder,

Reads an unsigned 32-bit integer at an offset.
Source§

fn read_i32_at<T>(&self, pos: u64) -> Result<i32, Error>
where T: ByteOrder,

Reads a signed 32-bit integer at an offset.
Source§

fn read_u64_at<T>(&self, pos: u64) -> Result<u64, Error>
where T: ByteOrder,

Reads an unsigned 64-bit integer at an offset.
Source§

fn read_i64_at<T>(&self, pos: u64) -> Result<i64, Error>
where T: ByteOrder,

Reads a signed 64-bit integer at an offset.
Source§

fn read_uint_at<T>(&self, pos: u64, nbytes: usize) -> Result<u64, Error>
where T: ByteOrder,

Reads an unsigned nbytes-bit integer at an offset.
Source§

fn read_int_at<T>(&self, pos: u64, nbytes: usize) -> Result<i64, Error>
where T: ByteOrder,

Reads a signed nbytes-bit integer at an offset.
Source§

fn read_f32_at<T>(&self, pos: u64) -> Result<f32, Error>
where T: ByteOrder,

Reads a single-precision floating point number at an offset.
Source§

fn read_f64_at<T>(&self, pos: u64) -> Result<f64, Error>
where T: ByteOrder,

Reads a double-precision floating point number at an offset.
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.