pub struct AndroidSparse {
    file: File,
    total_size: u64,
    chunks: BTreeMap<u64, ChunkWithSize>,
}

Fields§

§file: File§total_size: u64§chunks: BTreeMap<u64, ChunkWithSize>

Implementations§

Trait Implementations§

source§

impl AsRawDescriptor for AndroidSparse

source§

fn as_raw_descriptor(&self) -> RawDescriptor

Returns the underlying raw descriptor. Read more
source§

impl Debug for AndroidSparse

source§

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

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

impl DiskFile for AndroidSparse

source§

fn try_clone(&self) -> Result<Box<dyn DiskFile>>

Creates a new DiskFile instance that shares the same underlying disk file image. IO operations to a DiskFile should affect all DiskFile instances with the same underlying disk file image. Read more
source§

impl DiskGetLen for AndroidSparse

source§

fn get_len(&self) -> Result<u64>

Get the current length of the disk in bytes.
source§

impl FileReadWriteAtVolatile for AndroidSparse

source§

fn read_at_volatile( &self, slice: VolatileSlice<'_>, offset: u64 ) -> Result<usize>

Reads bytes from this file at offset into the given slice, returning the number of bytes read on success. On Windows file pointer will update with the read, but on Linux the file pointer will not change.
source§

fn write_at_volatile( &self, _slice: VolatileSlice<'_>, _offset: u64 ) -> Result<usize>

Writes bytes to this file at offset from the given slice, returning the number of bytes written on success. On Windows file pointer will update with the write, but on Linux the file pointer will not change.
§

fn read_vectored_at_volatile( &self, bufs: &[VolatileSlice<'_>], offset: u64 ) -> Result<usize, Error>

Like read_at_volatile, except it reads to a slice of buffers. Data is copied to fill each buffer in order, with the final buffer written to possibly being only partially filled. This method must behave as a single call to read_at_volatile with the buffers concatenated would. The default implementation calls read_at_volatile with either the first nonempty buffer provided, or returns Ok(0) if none exists. On Windows file pointer will update with the read, but on Linux the file pointer will not change.
§

fn read_exact_at_volatile( &self, slice: VolatileSlice<'_>, offset: u64 ) -> Result<(), Error>

Reads bytes from this file at offset into the given slice until all bytes in the slice are read, or an error is returned. On Windows file pointer will update with the read, but on Linux the file pointer will not change.
§

fn write_vectored_at_volatile( &self, bufs: &[VolatileSlice<'_>], offset: u64 ) -> Result<usize, Error>

Like write_at_volatile, except that it writes from a slice of buffers. Data is copied from each buffer in order, with the final buffer read from possibly being only partially consumed. This method must behave as a call to write_at_volatile with the buffers concatenated would. The default implementation calls write_at_volatile with either the first nonempty buffer provided, or returns Ok(0) if none exists. On Windows file pointer will update with the write, but on Linux the file pointer will not change.
§

fn write_all_at_volatile( &self, slice: VolatileSlice<'_>, offset: u64 ) -> Result<(), Error>

Writes bytes to this file at offset from the given slice until all bytes in the slice are written, or an error is returned. On Windows file pointer will update with the write, but on Linux the file pointer will not change.
source§

impl FileSetLen for AndroidSparse

source§

fn set_len(&self, _len: u64) -> Result<()>

source§

impl ToAsyncDisk for AndroidSparse

source§

fn to_async_disk( self: Box<Self>, ex: &Executor ) -> DiskResult<Box<dyn AsyncDisk>>

Convert a boxed self in to a box-wrapped implementaiton of AsyncDisk. Used to convert a standard disk image to an async disk image. This conversion and the inverse are needed so that the Send DiskImage can be given to the block thread where it is converted to a non-Send AsyncDisk. The AsyncDisk can then be converted back and returned to the main device thread if the block device is destroyed or reset.

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> AsRawDescriptors for Twhere T: AsRawDescriptor,

§

fn as_raw_descriptors(&self) -> Vec<i32, Global>

Returns the underlying raw descriptors. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.