pub trait SessionManager: 'static {
type Orchestrator: Borrow<Self> + Send + Sync;
type Session;
const SUPPORTS_DECOMPRESSION: bool;
// Required methods
fn on_attach_vmo(
orchestrator: Arc<Self::Orchestrator>,
vmo: &Arc<Vmo>,
) -> impl Future<Output = Result<(), Status>> + Send;
fn open_session(
orchestrator: Arc<Self::Orchestrator>,
stream: SessionRequestStream,
offset_map: OffsetMap,
block_size: u32,
) -> impl Future<Output = Result<(), Error>> + Send;
fn get_info(&self) -> Cow<'_, DeviceInfo>;
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 Constants§
const SUPPORTS_DECOMPRESSION: bool
Required Associated Types§
Sourcetype Orchestrator: Borrow<Self> + Send + Sync
type Orchestrator: Borrow<Self> + Send + Sync
The Orchestrator is an object that holds the SessionManager and any other state that needs
to be shared between sessions. It is responsible for keeping the SessionManager alive.
We use this type instead of directly holding an Arc
type Session
Required Methods§
fn on_attach_vmo( orchestrator: Arc<Self::Orchestrator>, vmo: &Arc<Vmo>, ) -> impl Future<Output = Result<(), Status>> + Send
Sourcefn open_session(
orchestrator: Arc<Self::Orchestrator>,
stream: SessionRequestStream,
offset_map: OffsetMap,
block_size: u32,
) -> impl Future<Output = Result<(), Error>> + Send
fn open_session( orchestrator: Arc<Self::Orchestrator>, 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.
Sourcefn get_info(&self) -> Cow<'_, DeviceInfo>
fn get_info(&self) -> Cow<'_, DeviceInfo>
Called to get block/partition information for Block::GetInfo, Partition::GetTypeGuid, etc.
Sourcefn active_requests(&self) -> &ActiveRequests<Self::Session>
fn active_requests(&self) -> &ActiveRequests<Self::Session>
Returns the active requests.
Provided Methods§
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.