Trait disk::ToAsyncDisk
source · pub trait ToAsyncDisk: AsRawDescriptors + DiskGetLen + Send {
// Required method
fn to_async_disk(
self: Box<Self>,
ex: &Executor
) -> Result<Box<dyn AsyncDisk>>;
}
Expand description
A DiskFile
that can be converted for asychronous access.
Required Methods§
sourcefn to_async_disk(self: Box<Self>, ex: &Executor) -> Result<Box<dyn AsyncDisk>>
fn to_async_disk(self: Box<Self>, ex: &Executor) -> Result<Box<dyn AsyncDisk>>
Convert a boxed self in to a box-wrapped implementaiton of AsyncDisk.
Used to convert a standard disk image to an async disk image. This conversion and the
inverse are needed so that the Send
DiskImage can be given to the block thread where it is
converted to a non-Send
AsyncDisk. The AsyncDisk can then be converted back and returned
to the main device thread if the block device is destroyed or reset.