#[non_exhaustive]pub struct Cargo<Package = Option<Package>, Workspace = Option<Workspace>> {Show 17 fields
pub cargo_features: BTreeSet<String>,
pub package: Package,
pub lib: Option<Target>,
pub bins: Vec<Target>,
pub examples: Vec<Target>,
pub tests: Vec<Target>,
pub benches: Vec<Target>,
pub dependencies: Table,
pub dev_dependencies: Table,
pub build_dependencies: Table,
pub target: Table,
pub badges: Table,
pub features: Table,
pub patch: Table,
pub replace: Table,
pub profile: Table,
pub workspace: Workspace,
/* private fields */
}
This is supported on crate features
serde
and toml
only.Expand description
Cargo.toml
— The root of the parsed manifest, without context like “what was Cargo.toml’s path?”
Fields (Non-exhaustive)
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.cargo_features: BTreeSet<String>
package: Package
lib: Option<Target>
bins: Vec<Target>
examples: Vec<Target>
tests: Vec<Target>
benches: Vec<Target>
dependencies: Table
dev_dependencies: Table
build_dependencies: Table
target: Table
badges: Table
features: Table
patch: Table
replace: Table
profile: Table
workspace: Workspace
Implementations
sourceimpl<Package, Workspace> Cargo<Package, Workspace>
impl<Package, Workspace> Cargo<Package, Workspace>
pub fn take_workspace(self) -> (Cargo<Package, ()>, Workspace)
pub fn with_workspace<W>(self, workspace: W) -> Cargo<Package, W>
sourceimpl<Package, Workspace> Cargo<Option<Package>, Workspace>
impl<Package, Workspace> Cargo<Option<Package>, Workspace>
pub fn with_package(self) -> Option<Cargo<Package, Workspace>>
Trait Implementations
sourceimpl<'de, Package, Workspace> Deserialize<'de> for Cargo<Package, Workspace> where
Package: Deserialize<'de>,
Workspace: Deserialize<'de>,
impl<'de, Package, Workspace> Deserialize<'de> for Cargo<Package, Workspace> where
Package: Deserialize<'de>,
Workspace: Deserialize<'de>,
sourcefn 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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl<Package, Workspace> RefUnwindSafe for Cargo<Package, Workspace> where
Package: RefUnwindSafe,
Workspace: RefUnwindSafe,
impl<Package, Workspace> Send for Cargo<Package, Workspace> where
Package: Send,
Workspace: Send,
impl<Package, Workspace> Sync for Cargo<Package, Workspace> where
Package: Sync,
Workspace: Sync,
impl<Package, Workspace> Unpin for Cargo<Package, Workspace> where
Package: Unpin,
Workspace: Unpin,
impl<Package, Workspace> UnwindSafe for Cargo<Package, Workspace> where
Package: UnwindSafe,
Workspace: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more