pub trait Interface:
    Send
    + Sync
    + Unpin
    + 'static {
Show 13 methods // Required methods fn get_info( &self, ) -> impl Future<Output = Result<Cow<'_, DeviceInfo>, Status>> + Send; fn read( &self, device_block_offset: u64, block_count: u32, vmo: &Arc<Vmo>, vmo_offset: u64, trace_flow_id: Option<NonZero<u64>>, ) -> impl Future<Output = Result<(), Status>> + Send; fn write( &self, device_block_offset: u64, block_count: u32, vmo: &Arc<Vmo>, vmo_offset: u64, opts: WriteOptions, trace_flow_id: Option<NonZero<u64>>, ) -> impl Future<Output = Result<(), Status>> + Send; fn barrier(&self) -> Result<(), Status>; fn flush( &self, trace_flow_id: Option<NonZero<u64>>, ) -> impl Future<Output = Result<(), Status>> + Send; fn trim( &self, device_block_offset: u64, block_count: u32, trace_flow_id: Option<NonZero<u64>>, ) -> impl Future<Output = Result<(), Status>> + Send; // Provided methods fn open_session( &self, session_manager: Arc<SessionManager<Self>>, stream: SessionRequestStream, offset_map: OffsetMap, block_size: u32, ) -> impl Future<Output = Result<(), Error>> + Send { ... } fn on_attach_vmo( &self, _vmo: &Vmo, ) -> impl Future<Output = Result<(), Status>> + Send { ... } fn on_detach_vmo(&self, _vmo: &Vmo) { ... } fn get_volume_info( &self, ) -> impl Future<Output = Result<(VolumeManagerInfo, VolumeInfo), Status>> + Send { ... } fn query_slices( &self, _start_slices: &[u64], ) -> impl Future<Output = Result<Vec<VsliceRange>, Status>> + Send { ... } fn extend( &self, _start_slice: u64, _slice_count: u64, ) -> impl Future<Output = Result<(), Status>> + Send { ... } fn shrink( &self, _start_slice: u64, _slice_count: u64, ) -> impl Future<Output = Result<(), Status>> + Send { ... }
}

Required Methods§

Source

fn get_info( &self, ) -> impl Future<Output = Result<Cow<'_, DeviceInfo>, Status>> + Send

Called to get block/partition information.

Source

fn read( &self, device_block_offset: u64, block_count: u32, vmo: &Arc<Vmo>, vmo_offset: u64, trace_flow_id: Option<NonZero<u64>>, ) -> impl Future<Output = Result<(), Status>> + Send

Called for a request to read bytes.

Source

fn write( &self, device_block_offset: u64, block_count: u32, vmo: &Arc<Vmo>, vmo_offset: u64, opts: WriteOptions, trace_flow_id: Option<NonZero<u64>>, ) -> impl Future<Output = Result<(), Status>> + Send

Called for a request to write bytes. WriteOptions::PRE_BARRIER should never be seen for this call. See barrier().

Source

fn barrier(&self) -> Result<(), Status>

Indicates that all previously completed write operations should be made persistent prior to any write operations issued after this call. It is not specified how the barrier affects currently in-flight write operations. This corresponds to the use of the PRE_BARRIER flag that can be used on a write request. Requests with that flag will be converted into separate barrier and write calls, and the write call above will not ever include the WriteOptions::PRE_BARRIER within opts.

Source

fn flush( &self, trace_flow_id: Option<NonZero<u64>>, ) -> impl Future<Output = Result<(), Status>> + Send

Called to flush the device.

Source

fn trim( &self, device_block_offset: u64, block_count: u32, trace_flow_id: Option<NonZero<u64>>, ) -> impl Future<Output = Result<(), Status>> + Send

Called to trim a region.

Provided Methods§

Source

fn open_session( &self, session_manager: Arc<SessionManager<Self>>, stream: SessionRequestStream, offset_map: OffsetMap, block_size: u32, ) -> impl Future<Output = Result<(), Error>> + Send

Runs stream to completion.

Implementors can override this method if they want to create a passthrough session instead (and can use [PassthroughSession] below to do so). See fuchsia.hardware.block.Block/OpenSessionWithOffsetMap.

If the implementor uses a [PassthroughSession], the following Interface methods will not be called, and can be stubbed out:

  • on_attach_vmo
  • on_detach_vmo
  • read
  • write
  • flush
  • trim
Source

fn on_attach_vmo( &self, _vmo: &Vmo, ) -> impl Future<Output = Result<(), Status>> + Send

Called whenever a VMO is attached, prior to the VMO’s usage in any other methods. Whilst the VMO is attached, vmo will keep the same address so it is safe to use the pointer value (as, say, a key into a HashMap).

Source

fn on_detach_vmo(&self, _vmo: &Vmo)

Called whenever a VMO is detached.

Source

fn get_volume_info( &self, ) -> impl Future<Output = Result<(VolumeManagerInfo, VolumeInfo), Status>> + Send

Called to handle the GetVolumeInfo FIDL call.

Source

fn query_slices( &self, _start_slices: &[u64], ) -> impl Future<Output = Result<Vec<VsliceRange>, Status>> + Send

Called to handle the QuerySlices FIDL call.

Source

fn extend( &self, _start_slice: u64, _slice_count: u64, ) -> impl Future<Output = Result<(), Status>> + Send

Called to handle the Extend FIDL call.

Source

fn shrink( &self, _start_slice: u64, _slice_count: u64, ) -> impl Future<Output = Result<(), Status>> + Send

Called to handle the Shrink FIDL call.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§