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>
Trait Implementations§
Source§impl Drop for PartitionBackend
impl Drop for PartitionBackend
Source§impl Interface for PartitionBackend
impl Interface for PartitionBackend
Source§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§async fn get_info(&self) -> Result<Cow<'_, PartitionInfo>, Status>
async fn get_info(&self) -> Result<Cow<'_, PartitionInfo>, Status>
Called to get partition information.
Source§async fn read(
&self,
device_block_offset: u64,
block_count: u32,
vmo: &Arc<Vmo>,
vmo_offset: u64,
) -> Result<(), Status>
async fn read( &self, device_block_offset: u64, block_count: u32, vmo: &Arc<Vmo>, vmo_offset: 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,
) -> Result<(), Status>
async fn write( &self, device_block_offset: u64, length: u32, vmo: &Arc<Vmo>, vmo_offset: u64, opts: WriteOptions, ) -> Result<(), Status>
Called for a request to write bytes.
Source§async fn trim(
&self,
device_block_offset: u64,
block_count: u32,
) -> Result<(), Status>
async fn trim( &self, device_block_offset: u64, block_count: u32, ) -> Result<(), Status>
Called to trim a region.
§fn on_detach_vmo(&self, _vmo: &Vmo)
fn on_detach_vmo(&self, _vmo: &Vmo)
Called whenever a VMO is detached.
§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.
§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