Struct ramdevice_client::RamdiskClient
source · pub struct RamdiskClient { /* private fields */ }
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.
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 async fn open(&self) -> Result<ClientEnd<BlockMarker>, Error>
pub async fn open(&self) -> Result<ClientEnd<BlockMarker>, Error>
Get an open channel to the underlying ramdevice.
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.