pub struct Dependency {
pub name: &'static str,
pub version: &'static str,
pub default_features: bool,
pub features: Vec<&'static str>,
}Expand description
A crate the generated code references, with the version requirement and Cargo
features a consumer must declare in Cargo.toml.
Fields§
§name: &'static strThe crates.io crate name (for example axum-extra).
version: &'static strRecommended version requirement (taken from this crate’s manifest, so it matches the version the generated code is built and tested against).
default_features: boolWhether the crate’s default features are needed.
features: Vec<&'static str>Cargo features the generated code relies on, in a stable order.
Implementations§
Source§impl Dependency
impl Dependency
Sourcepub fn toml(&self) -> String
pub fn toml(&self) -> String
Render the Cargo.toml [dependencies] entry for this crate.
A crate needing neither features nor a default-features change renders
as the short name = "version" form. Otherwise the inline-table form.
Sourcepub fn cargo_add_args(&self) -> Vec<String>
pub fn cargo_add_args(&self) -> Vec<String>
The cargo arguments that add this dependency, for std::process::Command.
Trait Implementations§
Source§impl Clone for Dependency
impl Clone for Dependency
Source§fn clone(&self) -> Dependency
fn clone(&self) -> Dependency
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Dependency
impl Debug for Dependency
impl Eq for Dependency
Source§impl PartialEq for Dependency
impl PartialEq for Dependency
impl StructuralPartialEq for Dependency
Auto Trait Implementations§
impl Freeze for Dependency
impl RefUnwindSafe for Dependency
impl Send for Dependency
impl Sync for Dependency
impl Unpin for Dependency
impl UnsafeUnpin for Dependency
impl UnwindSafe for Dependency
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
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
Compare self to
key and return true if they are equal.