Trait cargo_toml::AbstractFilesystem
source · pub trait AbstractFilesystem {
// Required method
fn file_names_in(&self, rel_path: &str) -> Result<HashSet<Box<str>>>;
// Provided method
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).
The implementation must have a concept of the current directory, which is set to the crate’s manifest dir.
Required Methods§
Provided Methods§
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.