Manifest

Struct Manifest 

Source
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

Source

pub fn load(path: impl AsRef<Path>) -> Result<Self, FindManifestError>

Load a manifest from the file system.

Source

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.

Source

pub fn crate_name(&self) -> Option<&str>

Extract the path to the crate name from the manifest.

Source

pub fn readme(&self) -> PathBuf

Extract the path to the readme file from the manifest.

If the readme doesn’t exist, assume README.md.

Source

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§

Source§

impl Debug for Manifest

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.