[−][src]Struct cargo_manifest::Manifest
The top-level Cargo.toml
structure
The Metadata
is a type for [package.metadata]
table. You can replace it with
your own struct type if you use the metadata and don't want to use the catch-all Value
type.
Fields
package: Option<Package<Metadata>>
workspace: Option<Workspace>
dependencies: Option<DepsSet>
dev_dependencies: Option<DepsSet>
build_dependencies: Option<DepsSet>
target: Option<TargetDepsSet>
features: Option<FeatureSet>
bin: Option<Vec<Product>>
Note that due to autobins feature this is not the complete list
unless you run complete_from_path
bench: Option<Vec<Product>>
test: Option<Vec<Product>>
example: Option<Vec<Product>>
patch: Option<PatchSet>
lib: Option<Product>
Note that due to autolibs feature this is not the complete list
unless you run complete_from_path
profile: Option<Profiles>
badges: Option<Badges>
Implementations
impl Manifest<Value>
[src]
pub fn from_slice(cargo_toml_content: &[u8]) -> Result<Self, Error>
[src]
Parse contents of a Cargo.toml
file already loaded as a byte slice.
It does not call complete_from_path
, so may be missing implicit data.
pub fn from_path(cargo_toml_path: impl AsRef<Path>) -> Result<Self, Error>
[src]
Parse contents from a Cargo.toml
file on disk.
Calls complete_from_path
.
pub fn from_str(cargo_toml_content: &str) -> Result<Self, Error>
[src]
Parse contents of a Cargo.toml
file loaded as a string
Note: this is not a file name, but file's content. See from_path
.
It does not call complete_from_path
, so may be missing implicit data.
impl<Metadata: for<'a> Deserialize<'a>> Manifest<Metadata>
[src]
pub fn from_slice_with_metadata(
cargo_toml_content: &[u8]
) -> Result<Self, Error>
[src]
cargo_toml_content: &[u8]
) -> Result<Self, Error>
Parse Cargo.toml
, and parse its [package.metadata]
into a custom Serde-compatible type.package
It does not call complete_from_path
, so may be missing implicit data.
pub fn from_path_with_metadata(
cargo_toml_path: impl AsRef<Path>
) -> Result<Self, Error>
[src]
cargo_toml_path: impl AsRef<Path>
) -> Result<Self, Error>
Parse contents from Cargo.toml
file on disk, with custom Serde-compatible metadata type.
Calls complete_from_path
pub fn complete_from_path(&mut self, path: &Path) -> Result<(), Error>
[src]
Cargo.toml
doesn't contain explicit information about [lib]
and [[bin]]
,
which are inferred based on files on disk.
This scans the disk to make the data in the manifest as complete as possible.
pub fn complete_from_abstract_filesystem(
&mut self,
fs: impl AbstractFilesystem
) -> Result<(), Error>
[src]
&mut self,
fs: impl AbstractFilesystem
) -> Result<(), Error>
Cargo.toml
doesn't contain explicit information about [lib]
and [[bin]]
,
which are inferred based on files on disk.
You can provide any implementation of directory scan, which doesn't have to be reading straight from disk (might scan a tarball or a git repo, for example).
Trait Implementations
impl<Metadata: Clone> Clone for Manifest<Metadata>
[src]
impl<Metadata: Debug> Debug for Manifest<Metadata>
[src]
impl<'de, Metadata> Deserialize<'de> for Manifest<Metadata> where
Metadata: Deserialize<'de>,
[src]
Metadata: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<Metadata: PartialEq> PartialEq<Manifest<Metadata>> for Manifest<Metadata>
[src]
fn eq(&self, other: &Manifest<Metadata>) -> bool
[src]
fn ne(&self, other: &Manifest<Metadata>) -> bool
[src]
impl<Metadata> Serialize for Manifest<Metadata> where
Metadata: Serialize,
[src]
Metadata: Serialize,
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<Metadata> StructuralPartialEq for Manifest<Metadata>
[src]
Auto Trait Implementations
impl<Metadata> RefUnwindSafe for Manifest<Metadata> where
Metadata: RefUnwindSafe,
Metadata: RefUnwindSafe,
impl<Metadata> Send for Manifest<Metadata> where
Metadata: Send,
Metadata: Send,
impl<Metadata> Sync for Manifest<Metadata> where
Metadata: Sync,
Metadata: Sync,
impl<Metadata> Unpin for Manifest<Metadata> where
Metadata: Unpin,
Metadata: Unpin,
impl<Metadata> UnwindSafe for Manifest<Metadata> where
Metadata: UnwindSafe,
Metadata: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,