Skip to main content

ByteIO

Trait ByteIO 

Source
pub trait ByteIO<A: Access>: ByteIOLayout {
    // Required method
    async fn read_or_write(
        &self,
        offset: u64,
        operation: Operation<'_, A>,
    ) -> Result<(), Self::Error>;

    // Provided methods
    async fn read(&self, offset: u64, buf: &mut [u8]) -> Result<(), Self::Error>
       where A: ReadAccess { ... }
    async fn write(&self, offset: u64, buf: &[u8]) -> Result<(), Self::Error>
       where A: WriteAccess { ... }
}

Required Methods§

Source

async fn read_or_write( &self, offset: u64, operation: Operation<'_, A>, ) -> Result<(), Self::Error>

Provided Methods§

Source

async fn read(&self, offset: u64, buf: &mut [u8]) -> Result<(), Self::Error>
where A: ReadAccess,

Source

async fn write(&self, offset: u64, buf: &[u8]) -> Result<(), Self::Error>
where A: WriteAccess,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T: AsRef<[u8]> + AsMut<[u8]>> ByteIO<ReadWrite> for RefCell<SliceByteIO<T>>

Source§

async fn read_or_write( &self, offset: u64, operation: Operation<'_, ReadWrite>, ) -> Result<(), Self::Error>

Implementors§

Source§

impl<T: AsRef<[u8]>> ByteIO<ReadOnly> for SliceByteIO<T>

Source§

impl<T: BlockIO<A>, A: ReadAccess> ByteIO<A> for ByteIOAdapter<T>