Trait remote_block_device::BlockClient
source · pub trait BlockClient: Send + Sync {
// Required methods
fn attach_vmo<'life0, 'life1, 'async_trait>(
&'life0 self,
vmo: &'life1 Vmo
) -> Pin<Box<dyn Future<Output = Result<VmoId, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn detach_vmo<'life0, 'async_trait>(
&'life0 self,
vmo_id: VmoId
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn read_at<'life0, 'life1, 'async_trait>(
&'life0 self,
buffer_slice: MutableBufferSlice<'life1>,
device_offset: u64
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn write_at<'life0, 'life1, 'async_trait>(
&'life0 self,
buffer_slice: BufferSlice<'life1>,
device_offset: u64
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn flush<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn close<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn block_size(&self) -> u32;
fn block_count(&self) -> u64;
fn is_connected(&self) -> bool;
}
Expand description
Represents a client connection to a block device. This is a simplified version of the block.fidl interface. Most users will use the RemoteBlockClient instantiation of this trait.
Required Methods§
sourcefn attach_vmo<'life0, 'life1, 'async_trait>(
&'life0 self,
vmo: &'life1 Vmo
) -> Pin<Box<dyn Future<Output = Result<VmoId, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn attach_vmo<'life0, 'life1, 'async_trait>( &'life0 self, vmo: &'life1 Vmo ) -> Pin<Box<dyn Future<Output = Result<VmoId, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,
Wraps AttachVmo from fuchsia.hardware.block::Block.
sourcefn detach_vmo<'life0, 'async_trait>(
&'life0 self,
vmo_id: VmoId
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn detach_vmo<'life0, 'async_trait>( &'life0 self, vmo_id: VmoId ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Detaches the given vmo-id from the device.
sourcefn read_at<'life0, 'life1, 'async_trait>(
&'life0 self,
buffer_slice: MutableBufferSlice<'life1>,
device_offset: u64
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn read_at<'life0, 'life1, 'async_trait>( &'life0 self, buffer_slice: MutableBufferSlice<'life1>, device_offset: u64 ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,
Reads from the device at |device_offset| into the given buffer slice.
sourcefn write_at<'life0, 'life1, 'async_trait>(
&'life0 self,
buffer_slice: BufferSlice<'life1>,
device_offset: u64
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn write_at<'life0, 'life1, 'async_trait>( &'life0 self, buffer_slice: BufferSlice<'life1>, device_offset: u64 ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,
Writes the data in |buffer_slice| to the device.
sourcefn flush<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn flush<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Sends a flush request to the underlying block device.
sourcefn close<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn close<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Closes the fifo.
sourcefn block_size(&self) -> u32
fn block_size(&self) -> u32
Returns the block size of the device.
sourcefn block_count(&self) -> u64
fn block_count(&self) -> u64
Returns the size, in blocks, of the device.
sourcefn is_connected(&self) -> bool
fn is_connected(&self) -> bool
Returns true if the remote fifo is still connected.