Skip to main content

SessionManager

Struct SessionManager 

Source
pub struct SessionManager<I: Interface + ?Sized> { /* private fields */ }

Implementations§

Source§

impl<I: Interface + ?Sized> SessionManager<I>

Source

pub fn new(interface: Arc<I>) -> Self

Source

pub fn interface(&self) -> &I

Source

pub async fn serve_session( self: Arc<Self>, stream: SessionRequestStream, offset_map: OffsetMap, block_size: u32, ) -> Result<(), Error>

Runs stream until completion.

Trait Implementations§

Source§

impl<I: Interface + ?Sized> Drop for SessionManager<I>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

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

Source§

const SUPPORTS_DECOMPRESSION: bool = true

Source§

type Orchestrator = SessionManager<I>

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 in BlockServer, to avoid nested Arcs in concrete implementations which need to keep additional state.
Source§

type Session = usize

Source§

async fn on_attach_vmo( orchestrator: Arc<Self>, vmo: &Arc<Vmo>, ) -> Result<(), Status>

Source§

async fn open_session( orchestrator: Arc<Self>, stream: SessionRequestStream, offset_map: OffsetMap, block_size: u32, ) -> Result<(), Error>

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) -> Cow<'_, DeviceInfo>

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

async fn get_volume_info( &self, ) -> Result<(VolumeManagerInfo, VolumeInfo), Status>

Called to handle the GetVolumeInfo FIDL call.
Source§

async fn query_slices( &self, start_slices: &[u64], ) -> Result<Vec<VsliceRange>, Status>

Called to handle the QuerySlices FIDL call.
Source§

async fn extend(&self, start_slice: u64, slice_count: u64) -> Result<(), Status>

Called to handle the Shrink FIDL call.
Source§

async fn shrink(&self, start_slice: u64, slice_count: u64) -> Result<(), Status>

Called to handle the Shrink FIDL call.
Source§

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

Returns the active requests.

Auto Trait Implementations§

§

impl<I> !Freeze for SessionManager<I>

§

impl<I> !RefUnwindSafe for SessionManager<I>

§

impl<I> Send for SessionManager<I>
where I: ?Sized,

§

impl<I> Sync for SessionManager<I>
where I: ?Sized,

§

impl<I> Unpin for SessionManager<I>
where I: ?Sized,

§

impl<I> UnsafeUnpin for SessionManager<I>
where I: ?Sized,

§

impl<I> !UnwindSafe for SessionManager<I>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T, D> Encode<Ambiguous1, D> for T
where D: ResourceDialect,

Source§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _offset: usize, _depth: Depth, ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
Source§

impl<T, D> Encode<Ambiguous2, D> for T
where D: ResourceDialect,

Source§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _offset: usize, _depth: Depth, ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V