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.
Auto Trait Implementations§
impl Freeze for Filesystem
impl !RefUnwindSafe for Filesystem
impl Send for Filesystem
impl Sync for Filesystem
impl Unpin for Filesystem
impl !UnwindSafe for Filesystem
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
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> IntoAny for T
impl<T> IntoAny for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more