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 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.