pub trait Interface:
Send
+ Sync
+ Unpin
+ 'static {
// Required methods
fn get_info(
&self,
) -> impl Future<Output = Result<Cow<'_, PartitionInfo>, Status>> + Send;
fn read(
&self,
device_block_offset: u64,
block_count: u32,
vmo: &Arc<Vmo>,
vmo_offset: 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,
) -> impl Future<Output = Result<(), Status>> + Send;
fn flush(&self) -> impl Future<Output = Result<(), Status>> + Send;
fn trim(
&self,
device_block_offset: u64,
block_count: u32,
) -> impl Future<Output = Result<(), Status>> + Send;
// Provided methods
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§
Sourcefn get_info(
&self,
) -> impl Future<Output = Result<Cow<'_, PartitionInfo>, Status>> + Send
fn get_info( &self, ) -> impl Future<Output = Result<Cow<'_, PartitionInfo>, Status>> + Send
Called to get partition information.
Sourcefn read(
&self,
device_block_offset: u64,
block_count: u32,
vmo: &Arc<Vmo>,
vmo_offset: u64,
) -> impl Future<Output = Result<(), Status>> + Send
fn read( &self, device_block_offset: u64, block_count: u32, vmo: &Arc<Vmo>, vmo_offset: u64, ) -> impl Future<Output = Result<(), Status>> + Send
Called for a request to read bytes.
Provided Methods§
Sourcefn on_attach_vmo(
&self,
_vmo: &Vmo,
) -> impl Future<Output = Result<(), Status>> + Send
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).
Sourcefn on_detach_vmo(&self, _vmo: &Vmo)
fn on_detach_vmo(&self, _vmo: &Vmo)
Called whenever a VMO is detached.
Sourcefn get_volume_info(
&self,
) -> impl Future<Output = Result<(VolumeManagerInfo, VolumeInfo), Status>> + Send
fn get_volume_info( &self, ) -> impl Future<Output = Result<(VolumeManagerInfo, VolumeInfo), Status>> + Send
Called to handle the GetVolumeInfo FIDL call.
Sourcefn query_slices(
&self,
_start_slices: &[u64],
) -> impl Future<Output = Result<Vec<VsliceRange>, Status>> + Send
fn query_slices( &self, _start_slices: &[u64], ) -> impl Future<Output = Result<Vec<VsliceRange>, Status>> + Send
Called to handle the QuerySlices 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.