pub trait FileSystem {
type FileSystemImpl: FileSystem;
// Required methods
fn new(uri: &Iri<'_>, conf: &Configuration) -> Result<Self::FileSystemImpl>;
fn resolve_symlinks(&self) -> bool;
fn get_uri(&self) -> Iri<'_>;
fn get_home_directory(&self) -> Result<Path>;
fn get_working_directory(&self) -> &Path;
fn mkdirs(
&self,
f: &Path,
permission: Option<&FsPermission>,
) -> Result<bool>;
// Provided methods
fn get_resolve_symlinks(conf: &Configuration) -> bool { ... }
fn get_default_uri(conf: &Configuration) -> Result<Iri<'_>> { ... }
fn get_scheme(&self) -> Result<&str> { ... }
fn fix_relative_part(&self, p: &Path) -> Result<Path> { ... }
}
Expand description
An abstract base class for a fairly generic filesystem. It may be implemented as a distributed filesystem, or as a “local” one that reflects the locally-connected disk. The local version exists for small Hadoop instances and for testing.
Required Associated Types§
Required Methods§
fn new(uri: &Iri<'_>, conf: &Configuration) -> Result<Self::FileSystemImpl>
Sourcefn resolve_symlinks(&self) -> bool
fn resolve_symlinks(&self) -> bool
Should symbolic links be resolved by FileSystemLinkResolver
.
Sourcefn get_home_directory(&self) -> Result<Path>
fn get_home_directory(&self) -> Result<Path>
Return the current user’s home directory in this FileSystem.
The default implementation returns "/user/$USER/"
.
Sourcefn get_working_directory(&self) -> &Path
fn get_working_directory(&self) -> &Path
Get the current working directory for the given FileSystem
Provided Methods§
fn get_resolve_symlinks(conf: &Configuration) -> bool
Sourcefn get_default_uri(conf: &Configuration) -> Result<Iri<'_>>
fn get_default_uri(conf: &Configuration) -> Result<Iri<'_>>
Get the default FileSystem URI from a configuration.
Sourcefn get_scheme(&self) -> Result<&str>
fn get_scheme(&self) -> Result<&str>
Return the protocol scheme for this FileSystem.
Sourcefn fix_relative_part(&self, p: &Path) -> Result<Path>
fn fix_relative_part(&self, p: &Path) -> Result<Path>
See [FileContext#fix_relative_part
]
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.