pub enum RamdiskClient {
V1 {
block_dir: Option<DirectoryProxy>,
block_controller: Option<ControllerProxy>,
ramdisk_controller: Option<ControllerProxy>,
},
V2 {
outgoing: DirectoryProxy,
_event: EventPair,
},
}
Expand description
A client for managing a ramdisk. This can be created with the RamdiskClient::create
function or through the type returned by RamdiskClient::builder
to specify additional
options.
Variants§
V1
V1
Fields
block_dir: Option<DirectoryProxy>
The directory backing the block driver.
block_controller: Option<ControllerProxy>
The device controller for the block device.
ramdisk_controller: Option<ControllerProxy>
The device controller for the ramdisk.
V2
V2
Fields
outgoing: DirectoryProxy
The outgoing directory for the ram-disk.
Implementations§
Source§impl RamdiskClient
impl RamdiskClient
Sourcepub fn builder(block_size: u64, block_count: u64) -> RamdiskClientBuilder
pub fn builder(block_size: u64, block_count: u64) -> RamdiskClientBuilder
Create a new ramdisk builder with the given block_size and block_count.
Sourcepub async fn create(block_size: u64, block_count: u64) -> Result<Self, Error>
pub async fn create(block_size: u64, block_count: u64) -> Result<Self, Error>
Create a new ramdisk.
Sourcepub fn as_controller(&self) -> Option<&ControllerProxy>
pub fn as_controller(&self) -> Option<&ControllerProxy>
Get a reference to the block controller.
Sourcepub fn take_controller(&mut self) -> Option<ControllerProxy>
pub fn take_controller(&mut self) -> Option<ControllerProxy>
Take the block controller.
Sourcepub fn as_dir(&self) -> Option<&DirectoryProxy>
pub fn as_dir(&self) -> Option<&DirectoryProxy>
Get a reference to the block directory proxy.
Sourcepub fn take_dir(&mut self) -> Option<DirectoryProxy>
pub fn take_dir(&mut self) -> Option<DirectoryProxy>
Take the block directory proxy.
Sourcepub fn open(&self) -> Result<ClientEnd<BlockMarker>, Error>
pub fn open(&self) -> Result<ClientEnd<BlockMarker>, Error>
Get an open channel to the underlying ramdevice.
Sourcepub fn connector(&self) -> Result<Box<dyn BlockConnector>, Error>
pub fn connector(&self) -> Result<Box<dyn BlockConnector>, Error>
Gets a connector for the Block protocol of the ramdisk.
Sourcepub fn connect(&self, server_end: ServerEnd<BlockMarker>) -> Result<(), Error>
pub fn connect(&self, server_end: ServerEnd<BlockMarker>) -> Result<(), Error>
Get an open channel to the underlying ramdevice.
Sourcepub fn open_controller(&self) -> Result<ClientEnd<ControllerMarker>, Error>
pub fn open_controller(&self) -> Result<ClientEnd<ControllerMarker>, Error>
Get an open channel to the underlying ramdevice’s controller.
Sourcepub async fn destroy(self) -> Result<(), Error>
pub async fn destroy(self) -> Result<(), Error>
Starts unbinding the underlying ramdisk and returns before the device is removed. This deallocates all resources for this ramdisk, which will remove all data written to the associated ramdisk.
Sourcepub async fn destroy_and_wait_for_removal(self) -> Result<(), Error>
pub async fn destroy_and_wait_for_removal(self) -> Result<(), Error>
Unbinds the underlying ramdisk and waits for the device and all child devices to be removed. This deallocates all resources for this ramdisk, which will remove all data written to the associated ramdisk.
Trait Implementations§
Source§impl BlockConnector for RamdiskClient
impl BlockConnector for RamdiskClient
fn connect_channel_to_volume( &self, server_end: ServerEnd<VolumeMarker>, ) -> Result<(), Error>
fn connect_volume(&self) -> Result<ClientEnd<VolumeMarker>, Error>
fn connect_partition(&self) -> Result<ClientEnd<PartitionMarker>, Error>
fn connect_block(&self) -> Result<ClientEnd<BlockMarker>, Error>
Auto Trait Implementations§
impl Freeze for RamdiskClient
impl !RefUnwindSafe for RamdiskClient
impl Send for RamdiskClient
impl Sync for RamdiskClient
impl Unpin for RamdiskClient
impl !UnwindSafe for RamdiskClient
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
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,
§impl<T> IntoAny for T
impl<T> IntoAny for T
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>
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>
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