Trait SessionManager

Source
pub trait SessionManager: 'static {
    type Session;

    // Required methods
    fn on_attach_vmo(
        self: Arc<Self>,
        vmo: &Arc<Vmo>,
    ) -> impl Future<Output = Result<(), Status>> + Send;
    fn open_session(
        self: Arc<Self>,
        stream: SessionRequestStream,
        offset_map: OffsetMap,
        block_size: u32,
    ) -> impl Future<Output = Result<(), Error>> + Send;
    fn get_info(
        &self,
    ) -> impl Future<Output = Result<Cow<'_, DeviceInfo>, Status>> + Send;
    fn active_requests(&self) -> &ActiveRequests<Self::Session>;

    // Provided methods
    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 Associated Types§

Required Methods§

Source

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

Source

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

Creates a new session to handle stream. The returned future should run until the session completes, for example when the client end closes. offset_map, will be used to adjust the block offset/length of FIFO requests.

Source

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

Called to get block/partition information for Block::GetInfo, Partition::GetTypeGuid, etc.

Source

fn active_requests(&self) -> &ActiveRequests<Self::Session>

Returns the active requests.

Provided Methods§

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 Shrink 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§

Source§

impl SessionManager for block_server::c_interface::SessionManager

Source§

impl<I: Interface + ?Sized> SessionManager for block_server::async_interface::SessionManager<I>