pub struct PartitionBackend { /* private fields */ }Expand description
PartitionBackend is an implementation of block_server’s Interface which is backed by a windowed view of the underlying GPT device.
Implementations§
Source§impl PartitionBackend
impl PartitionBackend
pub fn new(partition: Arc<GptPartition>) -> Arc<Self>
Sourcepub fn update_info(&self, info: PartitionInfo) -> PartitionInfo
pub fn update_info(&self, info: PartitionInfo) -> PartitionInfo
Returns the old info.
Trait Implementations§
Source§impl Drop for PartitionBackend
impl Drop for PartitionBackend
Source§impl Interface for PartitionBackend
impl Interface for PartitionBackend
Source§async fn open_session(
&self,
session_manager: Arc<SessionManager<Self>>,
stream: SessionRequestStream,
offset_map: OffsetMap,
block_size: u32,
) -> Result<(), Error>
async fn open_session( &self, session_manager: Arc<SessionManager<Self>>, stream: SessionRequestStream, offset_map: OffsetMap, block_size: u32, ) -> Result<(), Error>
Runs
stream to completion. Read moreSource§async fn on_attach_vmo(&self, vmo: &Vmo) -> Result<(), Status>
async fn on_attach_vmo(&self, vmo: &Vmo) -> Result<(), Status>
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 get_info(&self) -> Cow<'_, DeviceInfo>
fn get_info(&self) -> Cow<'_, DeviceInfo>
Called to get block/partition information.
Source§async fn read(
&self,
device_block_offset: u64,
block_count: u32,
vmo: &Arc<Vmo>,
vmo_offset: u64,
opts: ReadOptions,
trace_flow_id: Option<NonZero<u64>>,
) -> Result<(), Status>
async fn read( &self, device_block_offset: u64, block_count: u32, vmo: &Arc<Vmo>, vmo_offset: u64, opts: ReadOptions, trace_flow_id: Option<NonZero<u64>>, ) -> Result<(), Status>
Called for a request to read bytes.
Source§async fn write(
&self,
device_block_offset: u64,
length: u32,
vmo: &Arc<Vmo>,
vmo_offset: u64,
opts: WriteOptions,
trace_flow_id: Option<NonZero<u64>>,
) -> Result<(), Status>
async fn write( &self, device_block_offset: u64, length: u32, vmo: &Arc<Vmo>, vmo_offset: u64, opts: WriteOptions, trace_flow_id: Option<NonZero<u64>>, ) -> Result<(), Status>
Called for a request to write bytes.
Source§async fn flush(&self, trace_flow_id: Option<NonZero<u64>>) -> Result<(), Status>
async fn flush(&self, trace_flow_id: Option<NonZero<u64>>) -> Result<(), Status>
Called to flush the device.
Source§async fn trim(
&self,
device_block_offset: u64,
block_count: u32,
trace_flow_id: Option<NonZero<u64>>,
) -> Result<(), Status>
async fn trim( &self, device_block_offset: u64, block_count: u32, trace_flow_id: Option<NonZero<u64>>, ) -> Result<(), Status>
Called to trim a region.
Source§fn on_detach_vmo(&self, _vmo: &Vmo)
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
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
fn query_slices( &self, _start_slices: &[u64], ) -> impl Future<Output = Result<Vec<VsliceRange>, Status>> + Send
Called to handle the QuerySlices FIDL call.
Auto Trait Implementations§
impl !Freeze for PartitionBackend
impl !RefUnwindSafe for PartitionBackend
impl Send for PartitionBackend
impl Sync for PartitionBackend
impl Unpin for PartitionBackend
impl !UnwindSafe for PartitionBackend
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more