pub struct FakeBlockClient { /* private fields */ }
Expand description
A fake instance of BlockClient for use in tests.
Implementations§
Trait Implementations§
Source§impl BlockClient for FakeBlockClient
impl BlockClient for FakeBlockClient
Source§fn attach_vmo<'life0, 'life1, 'async_trait>(
&'life0 self,
vmo: &'life1 Vmo,
) -> Pin<Box<dyn Future<Output = Result<VmoId, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn attach_vmo<'life0, 'life1, 'async_trait>(
&'life0 self,
vmo: &'life1 Vmo,
) -> Pin<Box<dyn Future<Output = Result<VmoId, Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Wraps AttachVmo from fuchsia.hardware.block::Block.
Source§fn detach_vmo<'life0, 'async_trait>(
&'life0 self,
vmo_id: VmoId,
) -> Pin<Box<dyn Future<Output = Result<(), Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn detach_vmo<'life0, 'async_trait>(
&'life0 self,
vmo_id: VmoId,
) -> Pin<Box<dyn Future<Output = Result<(), Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Detaches the given vmo-id from the device.
Source§fn read_at<'life0, 'life1, 'async_trait>(
&'life0 self,
buffer_slice: MutableBufferSlice<'life1>,
device_offset: u64,
) -> Pin<Box<dyn Future<Output = Result<(), Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn read_at<'life0, 'life1, 'async_trait>(
&'life0 self,
buffer_slice: MutableBufferSlice<'life1>,
device_offset: u64,
) -> Pin<Box<dyn Future<Output = Result<(), Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Reads from the device at |device_offset| into the given buffer slice.
fn write_at_with_opts<'life0, 'life1, 'async_trait>(
&'life0 self,
buffer_slice: BufferSlice<'life1>,
device_offset: u64,
_opts: WriteOptions,
) -> Pin<Box<dyn Future<Output = Result<(), Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn trim<'life0, 'async_trait>(
&'life0 self,
range: Range<u64>,
) -> Pin<Box<dyn Future<Output = Result<(), Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn trim<'life0, 'async_trait>(
&'life0 self,
range: Range<u64>,
) -> Pin<Box<dyn Future<Output = Result<(), Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Trims the given range on the block device.
Source§fn flush<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn flush<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sends a flush request to the underlying block device.
Source§fn close<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn close<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Status>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Closes the fifo.
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 block_flags(&self) -> Flag
fn block_flags(&self) -> Flag
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 write_at<'life0, 'life1, 'async_trait>(
&'life0 self,
buffer_slice: BufferSlice<'life1>,
device_offset: u64,
) -> Pin<Box<dyn Future<Output = Result<(), Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn write_at<'life0, 'life1, 'async_trait>(
&'life0 self,
buffer_slice: BufferSlice<'life1>,
device_offset: u64,
) -> Pin<Box<dyn Future<Output = Result<(), Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Writes the data in |buffer_slice| to the device.
Auto Trait Implementations§
impl !Freeze for FakeBlockClient
impl RefUnwindSafe for FakeBlockClient
impl Send for FakeBlockClient
impl Sync for FakeBlockClient
impl Unpin for FakeBlockClient
impl UnwindSafe for FakeBlockClient
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