pub enum DependencyKind {
Normal,
Dev,
}Expand description
Which kind of dependency is declared.
Cabin distinguishes package dependency kinds (Normal, Dev)
— both of which are sourced from other Cabin packages — from
system dependencies, which are externally provided and never
enter Cabin resolution. System declarations live alongside the
package kinds as a separate system = true flag on a regular
[dependencies] / [dev-dependencies] entry and are modeled
by SystemDependency.
The wire format mirrors the manifest section names: "normal",
"dev".
Variants§
Normal
[dependencies]. Linked into ordinary builds.
Dev
[dev-dependencies]. Declaration-only for ordinary
commands; activated for the selected primary packages by
cabin test.
Implementations§
Source§impl DependencyKind
impl DependencyKind
Sourcepub const fn as_str(self) -> &'static str
pub const fn as_str(self) -> &'static str
Stable lowercase label, matching the manifest section name.
Sourcepub const fn all() -> &'static [DependencyKind]
pub const fn all() -> &'static [DependencyKind]
All kinds in canonical order. cabin metadata and the
canonical package metadata both iterate kinds in this order
so output stays deterministic.
Sourcepub const fn is_resolved_by_default(self) -> bool
pub const fn is_resolved_by_default(self) -> bool
Whether this kind is included in the resolver / fetch / build pipeline by default. Dev dependencies are excluded.
Sourcepub const fn affects_ordinary_build(self) -> bool
pub const fn affects_ordinary_build(self) -> bool
Whether this kind contributes link / include edges to
ordinary cabin build targets. Only Normal does.
Sourcepub fn is_normal(&self) -> bool
pub fn is_normal(&self) -> bool
Helper for #[serde(skip_serializing_if = ...)] so
existing on-disk metadata that omits the kind field
stays byte-identical for [dependencies]-only manifests.
Sourcepub const fn manifest_section(self) -> &'static str
pub const fn manifest_section(self) -> &'static str
The manifest section name ([dependencies],
[dev-dependencies]) corresponding to this kind.
Used in error messages.
Trait Implementations§
Source§impl Clone for DependencyKind
impl Clone for DependencyKind
Source§fn clone(&self) -> DependencyKind
fn clone(&self) -> DependencyKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DependencyKind
impl Debug for DependencyKind
Source§impl Default for DependencyKind
impl Default for DependencyKind
Source§fn default() -> DependencyKind
fn default() -> DependencyKind
Source§impl<'de> Deserialize<'de> for DependencyKind
impl<'de> Deserialize<'de> for DependencyKind
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>,
Source§impl Display for DependencyKind
impl Display for DependencyKind
Source§impl Hash for DependencyKind
impl Hash for DependencyKind
Source§impl Ord for DependencyKind
impl Ord for DependencyKind
Source§fn cmp(&self, other: &DependencyKind) -> Ordering
fn cmp(&self, other: &DependencyKind) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for DependencyKind
impl PartialEq for DependencyKind
Source§fn eq(&self, other: &DependencyKind) -> bool
fn eq(&self, other: &DependencyKind) -> bool
self and other values to be equal, and is used by ==.Source§impl PartialOrd for DependencyKind
impl PartialOrd for DependencyKind
Source§impl Serialize for DependencyKind
impl Serialize for DependencyKind
impl Copy for DependencyKind
impl Eq for DependencyKind
impl StructuralPartialEq for DependencyKind
Auto Trait Implementations§
impl Freeze for DependencyKind
impl RefUnwindSafe for DependencyKind
impl Send for DependencyKind
impl Sync for DependencyKind
impl Unpin for DependencyKind
impl UnsafeUnpin for DependencyKind
impl UnwindSafe for DependencyKind
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> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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.