pub struct ServingMultiVolumeFilesystem { /* private fields */ }
Expand description
Asynchronously manages a serving multivolume filesystem. Created from
Filesystem::serve_multi_volume()
.
Implementations§
Source§impl ServingMultiVolumeFilesystem
impl ServingMultiVolumeFilesystem
Sourcepub fn volume(&self, volume: &str) -> Option<&ServingVolume>
pub fn volume(&self, volume: &str) -> Option<&ServingVolume>
Gets a reference to the given volume, if it’s already open.
Sourcepub fn volume_mut(&mut self, volume: &str) -> Option<&mut ServingVolume>
pub fn volume_mut(&mut self, volume: &str) -> Option<&mut ServingVolume>
Gets a mutable reference to the given volume, if it’s already open.
pub fn close_volume(&mut self, volume: &str)
Sourcepub async fn shutdown_volume(&mut self, volume: &str) -> Result<(), Error>
pub async fn shutdown_volume(&mut self, volume: &str) -> Result<(), Error>
Attempts to shutdown the filesystem using the fidl_fuchsia_fs::AdminProxy::shutdown()
FIDL method. Fails if the volume is not already open.
Sourcepub async fn has_volume(&mut self, volume: &str) -> Result<bool, Error>
pub async fn has_volume(&mut self, volume: &str) -> Result<bool, Error>
Returns whether the given volume exists.
Sourcepub async fn create_volume(
&mut self,
volume: &str,
create_options: CreateOptions,
options: MountOptions,
) -> Result<&mut ServingVolume, Error>
pub async fn create_volume( &mut self, volume: &str, create_options: CreateOptions, options: MountOptions, ) -> Result<&mut ServingVolume, Error>
Creates and mounts the volume. Fails if the volume already exists.
If options.crypt
is set, the volume will be encrypted using the provided Crypt instance.
If options.as_blob
is set, creates a blob volume that is mounted as a blob filesystem.
Sourcepub async fn remove_volume(&mut self, volume: &str) -> Result<(), Error>
pub async fn remove_volume(&mut self, volume: &str) -> Result<(), Error>
Deletes the volume. Fails if the volume is already mounted.
Sourcepub async fn open_volume(
&mut self,
volume: &str,
options: MountOptions,
) -> Result<&mut ServingVolume, Error>
pub async fn open_volume( &mut self, volume: &str, options: MountOptions, ) -> Result<&mut ServingVolume, Error>
Mounts an existing volume. Fails if the volume is already mounted or doesn’t exist.
If crypt
is set, the volume will be decrypted using the provided Crypt instance.
Sourcepub async fn set_byte_limit(
&self,
volume: &str,
byte_limit: u64,
) -> Result<(), Error>
pub async fn set_byte_limit( &self, volume: &str, byte_limit: u64, ) -> Result<(), Error>
Sets the max byte limit for a volume. Fails if the volume is not mounted.
pub async fn check_volume( &mut self, volume: &str, crypt: Option<ClientEnd<CryptMarker>>, ) -> Result<(), Error>
Sourcepub fn exposed_dir(&self) -> &DirectoryProxy
pub fn exposed_dir(&self) -> &DirectoryProxy
Provides access to the internal |exposed_dir| for use in testing callsites which need directory access.
Sourcepub async fn shutdown(self) -> Result<(), ShutdownError>
pub async fn shutdown(self) -> Result<(), ShutdownError>
Attempts to shutdown the filesystem using the fidl_fuchsia_fs::AdminProxy::shutdown()
FIDL method.
§Errors
Returns Err
if the shutdown failed.
Sourcepub fn take_exposed_dir(self) -> DirectoryProxy
pub fn take_exposed_dir(self) -> DirectoryProxy
Take the exposed dir from this filesystem instance, dropping the management struct without shutting the filesystem down. This leaves the caller with the responsibility of shutting down the filesystem, and the filesystem component if necessary.