pub enum FileSystems {}Expand description
Global filesystem registry facade.
FileSystems is an uninhabited namespace type. It cannot be instantiated
and only exposes static methods backed by a process-wide registry.
Implementations§
Source§impl FileSystems
impl FileSystems
Sourcepub fn register<P>(provider: P) -> FsResult<()>where
P: ServiceProvider<FileSystemSpec> + 'static,
pub fn register<P>(provider: P) -> FsResult<()>where
P: ServiceProvider<FileSystemSpec> + 'static,
Sourcepub fn fs_for_uri(uri: &FsUri) -> FsResult<Arc<dyn FileSystem>>
pub fn fs_for_uri(uri: &FsUri) -> FsResult<Arc<dyn FileSystem>>
Sourcepub fn fs_for_scheme(scheme: &str) -> FsResult<Arc<dyn FileSystem>>
pub fn fs_for_scheme(scheme: &str) -> FsResult<Arc<dyn FileSystem>>
Resolves a filesystem instance from a URI scheme.
This is equivalent to resolving the minimal URI {scheme}:///. It is
only suitable for providers that can be created from default authority,
root path, and default options.
§Parameters
scheme: URI scheme used to select a provider.
§Returns
A filesystem instance created by the matching provider.
§Errors
Returns an error when the scheme cannot form a valid URI or no provider can create a filesystem from the minimal URI.
Sourcepub fn resource(uri: &str) -> FsResult<FileResource>
pub fn resource(uri: &str) -> FsResult<FileResource>
Resolves a URI into a bound file resource from the global registry.
§Parameters
uri: Filesystem URI.
§Returns
A file resource containing the matching filesystem and filesystem-local path.
§Errors
Returns an error when the URI cannot be parsed or no provider can create a filesystem for the URI scheme.