pub struct RemoteBlockClient { /* private fields */ }
Expand description
RemoteBlockClient is a BlockClient that communicates with a real block device over FIDL.
Implementations§
Source§impl RemoteBlockClient
impl RemoteBlockClient
Sourcepub async fn new(remote: impl AsBlockProxy) -> Result<Self, Status>
pub async fn new(remote: impl AsBlockProxy) -> Result<Self, Status>
Returns a connection to a remote block device via the given channel.
pub async fn from_session( info: BlockInfo, session: SessionProxy, ) -> Result<Self, Status>
Trait Implementations§
Source§impl BlockClient for RemoteBlockClient
impl BlockClient for RemoteBlockClient
Source§async fn attach_vmo(&self, vmo: &Vmo) -> Result<VmoId, Status>
async fn attach_vmo(&self, vmo: &Vmo) -> Result<VmoId, Status>
Wraps AttachVmo from fuchsia.hardware.block::Block.
Source§async fn detach_vmo(&self, vmo_id: VmoId) -> Result<(), Status>
async fn detach_vmo(&self, vmo_id: VmoId) -> Result<(), Status>
Detaches the given vmo-id from the device.
async fn read_at_with_opts_traced( &self, buffer_slice: MutableBufferSlice<'_>, device_offset: u64, opts: ReadOptions, trace_flow_id: u64, ) -> Result<(), Status>
async fn write_at_with_opts_traced( &self, buffer_slice: BufferSlice<'_>, device_offset: u64, opts: WriteOptions, trace_flow_id: u64, ) -> Result<(), Status>
async fn trim_traced( &self, range: Range<u64>, trace_flow_id: u64, ) -> Result<(), Status>
Source§async fn flush_traced(&self, trace_flow_id: u64) -> Result<(), Status>
async fn flush_traced(&self, trace_flow_id: u64) -> Result<(), Status>
Sends a flush request to the underlying block device.
Source§fn barrier(&self)
fn barrier(&self)
Attaches a barrier to the next write sent to the underlying block device. This barrier
method is an alternative to setting the WriteOption::PRE_BARRIER on
write_at_with_opts
.
This method makes it easier to guarantee that the barrier is attached to the correct
write operation when subsequent write operations can get reordered.Source§fn block_size(&self) -> u32
fn block_size(&self) -> u32
Returns the block size of the device.
Source§fn block_count(&self) -> u64
fn block_count(&self) -> u64
Returns the size, in blocks, of the device.
Source§fn max_transfer_blocks(&self) -> Option<NonZero<u32>>
fn max_transfer_blocks(&self) -> Option<NonZero<u32>>
Returns the maximum number of blocks which can be transferred in a single request.
Source§fn block_flags(&self) -> BlockFlags
fn block_flags(&self) -> BlockFlags
Returns the block flags reported by the device.
Source§fn is_connected(&self) -> bool
fn is_connected(&self) -> bool
Returns true if the remote fifo is still connected.
Source§fn read_at(
&self,
buffer_slice: MutableBufferSlice<'_>,
device_offset: u64,
) -> impl Future<Output = Result<(), Status>> + Send
fn read_at( &self, buffer_slice: MutableBufferSlice<'_>, device_offset: u64, ) -> impl Future<Output = Result<(), Status>> + Send
Reads from the device at |device_offset| into the given buffer slice.
fn read_at_with_opts( &self, buffer_slice: MutableBufferSlice<'_>, device_offset: u64, opts: ReadOptions, ) -> impl Future<Output = Result<(), Status>> + Send
Source§fn write_at(
&self,
buffer_slice: BufferSlice<'_>,
device_offset: u64,
) -> impl Future<Output = Result<(), Status>> + Send
fn write_at( &self, buffer_slice: BufferSlice<'_>, device_offset: u64, ) -> impl Future<Output = Result<(), Status>> + Send
Writes the data in |buffer_slice| to the device.
fn write_at_with_opts( &self, buffer_slice: BufferSlice<'_>, device_offset: u64, opts: WriteOptions, ) -> impl Future<Output = Result<(), Status>> + Send
Source§fn trim(
&self,
device_range: Range<u64>,
) -> impl Future<Output = Result<(), Status>> + Send
fn trim( &self, device_range: Range<u64>, ) -> impl Future<Output = Result<(), Status>> + Send
Trims the given range on the block device.
fn flush(&self) -> impl Future<Output = Result<(), Status>> + Send
Auto Trait Implementations§
impl !Freeze for RemoteBlockClient
impl !RefUnwindSafe for RemoteBlockClient
impl Send for RemoteBlockClient
impl Sync for RemoteBlockClient
impl Unpin for RemoteBlockClient
impl !UnwindSafe for RemoteBlockClient
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