pub struct Manifest {
pub package: ManifestPackage,
pub lib: Option<ManifestLibTarget>,
pub bin: Option<Vec<ManifestBinTarget>>,
pub features: Option<HashMap<String, HashSet<String>>>,
pub dependencies: Option<HashMap<String, ManifestDependency>>,
pub docs_meta: Option<ManifestDocsRsMetadata>,
}
Expand description
Package manifest.
It includes only fields that are necessary for locating and parsing readme and library documentation.
See https://doc.rust-lang.org/cargo/reference/manifest.html for more details.
Fields§
§package: ManifestPackage
Defines a package.
lib: Option<ManifestLibTarget>
Library target settings.
bin: Option<Vec<ManifestBinTarget>>
Binary target settings.
features: Option<HashMap<String, HashSet<String>>>
Conditional compilation features.
dependencies: Option<HashMap<String, ManifestDependency>>
Package library dependencies.
docs_meta: Option<ManifestDocsRsMetadata>
Metadata that customize docs.rs builds.
Implementations§
Source§impl Manifest
impl Manifest
Sourcepub fn from_name_and_version(name: String, version: String) -> Self
pub fn from_name_and_version(name: String, version: String) -> Self
Creates simple manifest from package name and version.
Sourcepub fn from_cargo_toml_content(content: &str) -> Result<Self, TomlParseError>
pub fn from_cargo_toml_content(content: &str) -> Result<Self, TomlParseError>
Creates manifest from Cargo.toml
file contents.
Sourcepub fn from_cargo_toml_path(path: &Path) -> Result<Self, TomlReadError>
pub fn from_cargo_toml_path(path: &Path) -> Result<Self, TomlReadError>
Reads manifest from a specified file path.
Sourcepub fn from_package_path(path: &Path) -> Result<Self, TomlReadError>
pub fn from_package_path(path: &Path) -> Result<Self, TomlReadError>
Reads manifest from the Cargo.toml
file in the specified package path.
Sourcepub fn relative_readme_path(&self, root: &Path) -> Option<&Path>
pub fn relative_readme_path(&self, root: &Path) -> Option<&Path>
Returns package relative readme path.
Sourcepub fn default_readme_filename(root: &Path) -> Option<&'static Path>
pub fn default_readme_filename(root: &Path) -> Option<&'static Path>
Returns package relative default readme path.
Sourcepub fn is_lib_documented_by_default(&self) -> bool
pub fn is_lib_documented_by_default(&self) -> bool
Returns true
if the package’s library is documented by default.
See https://doc.rust-lang.org/cargo/commands/cargo-doc.html for more details.
Sourcepub fn relative_lib_path(&self) -> &Path
pub fn relative_lib_path(&self) -> &Path
Returns package relative library file path.
See https://doc.rust-lang.org/cargo/commands/cargo-doc.html for more details.
Sourcepub fn default_relative_bin_path(&self) -> &'static Path
pub fn default_relative_bin_path(&self) -> &'static Path
Returns package relative default binary file path.
See https://doc.rust-lang.org/cargo/commands/cargo-doc.html for more details.
Sourcepub fn relative_bin_path(&self, name: &str) -> Result<PathBuf, BinPathError>
pub fn relative_bin_path(&self, name: &str) -> Result<PathBuf, BinPathError>
Returns package relative binary file path by the specified binary target name.
See https://doc.rust-lang.org/cargo/commands/cargo-doc.html for more details.
Sourcepub fn default_relative_target_path(&self) -> &Path
pub fn default_relative_target_path(&self) -> &Path
Returns package default library or binary target.
See https://doc.rust-lang.org/cargo/commands/cargo-doc.html for more details.
Sourcepub fn docs_rs_default_target(&self) -> &str
pub fn docs_rs_default_target(&self) -> &str
Returns package target used for docs.rs builds.
See https://docs.rs/about/metadata for more details.
Sourcepub fn default_features(&self) -> HashSet<&str>
pub fn default_features(&self) -> HashSet<&str>
Returns a default package features.
Sourcepub fn all_features(&self) -> HashSet<&str>
pub fn all_features(&self) -> HashSet<&str>
Returns all package features.
Sourcepub fn docs_rs_features(&self) -> HashSet<&str>
pub fn docs_rs_features(&self) -> HashSet<&str>
Returns package features used for docs.rs builds.
See https://docs.rs/about/metadata for more details.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Manifest
impl<'de> Deserialize<'de> for Manifest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Manifest
impl StructuralPartialEq for Manifest
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.