pub struct DefaultCallbackBlockService<I: Interface + ?Sized> { /* private fields */ }Expand description
Default fallback implementation of BlockService for
[callback_interface::Interface] backends (such as C++ drivers / virtio-block)
that return the default implementation from into_block_service.
Implementations§
Source§impl<I: Interface + ?Sized> DefaultCallbackBlockService<I>
impl<I: Interface + ?Sized> DefaultCallbackBlockService<I>
pub fn new(orchestrator: &Arc<I::Orchestrator>) -> Self
pub fn new_with_pool_capacity( orchestrator: &Arc<I::Orchestrator>, pool_capacity: usize, ) -> Self
pub fn orchestrator(&self) -> Option<Arc<I::Orchestrator>>
pub fn allocator(&self) -> &Arc<BufferAllocator> ⓘ
Trait Implementations§
Source§impl<I: Interface + ?Sized> BlockService for DefaultCallbackBlockService<I>
impl<I: Interface + ?Sized> BlockService for DefaultCallbackBlockService<I>
Source§fn allocate_buffer(&self, max_len: usize) -> OwnedBuffer
fn allocate_buffer(&self, max_len: usize) -> OwnedBuffer
Source§fn read_blocks(
&self,
device_offset: u64,
dest_buffer: OwnedBuffer,
on_complete: Box<dyn FnOnce(Result<OwnedBuffer, Error>) + Send>,
) -> Result<(), Error>
fn read_blocks( &self, device_offset: u64, dest_buffer: OwnedBuffer, on_complete: Box<dyn FnOnce(Result<OwnedBuffer, Error>) + Send>, ) -> Result<(), Error>
Submits a read for the specified range from
device_offset into dest_buffer.
When the read completes, on_complete is invoked with the result containing the buffer.Auto Trait Implementations§
impl<I> !RefUnwindSafe for DefaultCallbackBlockService<I>
impl<I> !UnwindSafe for DefaultCallbackBlockService<I>
impl<I> Freeze for DefaultCallbackBlockService<I>where
I: ?Sized,
impl<I> Send for DefaultCallbackBlockService<I>where
I: ?Sized,
impl<I> Sync for DefaultCallbackBlockService<I>where
I: ?Sized,
impl<I> Unpin for DefaultCallbackBlockService<I>where
I: ?Sized,
impl<I> UnsafeUnpin for DefaultCallbackBlockService<I>where
I: ?Sized,
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