pub trait AbstractFilesystem {
// Required method
fn file_names_in(&self, rel_path: &str) -> Result<HashSet<Box<str>>>;
// Provided methods
fn read_root_workspace(
&self,
_rel_path_hint: Option<&str>,
) -> Result<(Vec<u8>, PathBuf)> { ... }
fn parse_root_workspace(
&self,
rel_path_hint: Option<&str>,
) -> Result<(Manifest<Value>, PathBuf), Error> { ... }
}
Expand description
This crate supports reading Cargo.toml
not only from a real directory, but also directly from other sources, like tarballs or bare git repos (BYO directory reader).
Required Methods§
Provided Methods§
Sourcefn read_root_workspace(
&self,
_rel_path_hint: Option<&str>,
) -> Result<(Vec<u8>, PathBuf)>
fn read_root_workspace( &self, _rel_path_hint: Option<&str>, ) -> Result<(Vec<u8>, PathBuf)>
parse_root_workspace
is preferred.
The rel_path_hint
may be specified explicitly by package.workspace
(it may be relative like "../"
, without Cargo.toml
) or None
,
which means you have to search for workspace’s Cargo.toml
in parent directories.
Read bytes of the root workspace manifest TOML file and return the path it’s been read from. The path needs to be an absolute path, because it will be used as the base path for inherited readmes, and would be ambiguous otherwise.
Sourcefn parse_root_workspace(
&self,
rel_path_hint: Option<&str>,
) -> Result<(Manifest<Value>, PathBuf), Error>
fn parse_root_workspace( &self, rel_path_hint: Option<&str>, ) -> Result<(Manifest<Value>, PathBuf), Error>
The rel_path_hint
may be specified explicitly by package.workspace
(it may be relative like "../"
, without Cargo.toml
) or None
,
which means you have to search for workspace’s Cargo.toml
in parent directories.
Read and parse the root workspace manifest TOML file and return the path it’s been read from. The path needs to be an absolute path, because it will be used as the base path for inherited readmes, and would be ambiguous otherwise.