pub struct Manifest {
pub toml: Value,
pub parent_dir: PathBuf,
}
Expand description
The project manifest.
This type is used internally to retrieve various metadata on your project. The most important information for us
is the readme
field, which allows us to know which file we need to synchronize.
Fields§
§toml: Value
Deserialized manifest.
parent_dir: PathBuf
Path on the file system where the manifest exists.
Implementations§
Source§impl Manifest
impl Manifest
Sourcepub fn load(path: impl AsRef<Path>) -> Result<Self, FindManifestError>
pub fn load(path: impl AsRef<Path>) -> Result<Self, FindManifestError>
Load a manifest from the file system.
Sourcepub fn find_manifest(dir: impl AsRef<Path>) -> Result<Self, FindManifestError>
pub fn find_manifest(dir: impl AsRef<Path>) -> Result<Self, FindManifestError>
Get the TOML-formatted manifest by searching the current directory; if not found, go to the parent directory and recursively retry until one is found… eventually.
Sourcepub fn crate_name(&self) -> Option<&str>
pub fn crate_name(&self) -> Option<&str>
Extract the path to the crate name from the manifest.
Sourcepub fn readme(&self) -> PathBuf
pub fn readme(&self) -> PathBuf
Extract the path to the readme file from the manifest.
If the readme doesn’t exist, assume README.md
.
Sourcepub fn entry_point(
&self,
prefer_doc_from: Option<PreferDocFrom>,
) -> Option<PathBuf>
pub fn entry_point( &self, prefer_doc_from: Option<PreferDocFrom>, ) -> Option<PathBuf>
Get the path to the Rust file we want to take the documentation from.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Manifest
impl RefUnwindSafe for Manifest
impl Send for Manifest
impl Sync for Manifest
impl Unpin for Manifest
impl UnwindSafe for Manifest
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
Mutably borrows from an owned value. Read more