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 outgoing(&self) -> &DirectoryProxy
pub fn outgoing(&self) -> &DirectoryProxy
Returns the directory proxy for the ramdisk’s outgoing directory.
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_ramdisk(&self) -> Result<RamdiskProxy, Error>
pub fn open_ramdisk(&self) -> Result<RamdiskProxy, Error>
Get an open channel to the Ramdisk protocol.
Sourcepub fn into_event(self) -> EventPair
pub fn into_event(self) -> EventPair
Consume the client and return the event that keeps the ramdisk alive.
Trait Implementations§
Source§impl BlockConnector for RamdiskClient
impl BlockConnector for RamdiskClient
fn connect_channel_to_block( &self, server_end: ServerEnd<BlockMarker>, ) -> Result<(), 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 UnsafeUnpin 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
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,
§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
Converts the given service transport handle of type
T to [Self]