Struct fs_management::filesystem::Filesystem
source · pub struct Filesystem { /* private fields */ }
Expand description
Asynchronously manages a block device for filesystem operations.
Implementations§
source§impl Filesystem
impl Filesystem
pub fn config(&self) -> &dyn FSConfig
pub fn into_config(self) -> Box<dyn FSConfig>
sourcepub fn new<B: BlockConnector + 'static, FSC: FSConfig>(
block_connector: B,
config: FSC,
) -> Self
pub fn new<B: BlockConnector + 'static, FSC: FSConfig>( block_connector: B, config: FSC, ) -> Self
Creates a new Filesystem
.
sourcepub fn from_boxed_config(
block_connector: Box<dyn BlockConnector>,
config: Box<dyn FSConfig>,
) -> Self
pub fn from_boxed_config( block_connector: Box<dyn BlockConnector>, config: Box<dyn FSConfig>, ) -> Self
Creates a new Filesystem
.
sourcepub fn get_component_moniker(&self) -> Option<String>
pub fn get_component_moniker(&self) -> Option<String>
If the filesystem is a currently running component, returns its (relative) moniker.
sourcepub async fn format(&mut self) -> Result<(), Error>
pub async fn format(&mut self) -> Result<(), Error>
Calls fuchsia.fs.startup/Startup.Format on the configured filesystem component.
Which component is used and the options passed to it are controlled by the config this
Filesystem
was created with.
See FSConfig
.
§Errors
Returns any errors from the Format method. Also returns an error if the startup protocol is not found, if it couldn’t launch or find the filesystem component, or if it couldn’t get the block device channel.
sourcepub async fn fsck(&mut self) -> Result<(), Error>
pub async fn fsck(&mut self) -> Result<(), Error>
Calls fuchsia.fs.startup/Startup.Check on the configured filesystem component.
Which component is used and the options passed to it are controlled by the config this
Filesystem
was created with.
See FSConfig
.
§Errors
Returns any errors from the Check method. Also returns an error if the startup protocol is not found, if it couldn’t launch or find the filesystem component, or if it couldn’t get the block device channel.
sourcepub async fn serve(&mut self) -> Result<ServingSingleVolumeFilesystem, Error>
pub async fn serve(&mut self) -> Result<ServingSingleVolumeFilesystem, Error>
Serves the filesystem on the block device and returns a ServingSingleVolumeFilesystem
representing the running filesystem component.
§Errors
Returns Err
if serving the filesystem failed.
sourcepub async fn serve_multi_volume(
&mut self,
) -> Result<ServingMultiVolumeFilesystem, Error>
pub async fn serve_multi_volume( &mut self, ) -> Result<ServingMultiVolumeFilesystem, Error>
Serves the filesystem on the block device and returns a ServingMultiVolumeFilesystem
representing the running filesystem component. No volumes are opened; clients have to do
that explicitly.
§Errors
Returns Err
if serving the filesystem failed.