pub struct FollowConfig {
pub ignore: Vec<String>,
pub transitive_min: usize,
pub aliases: HashMap<String, Vec<String>>,
pub max_depth: Option<usize>,
}Expand description
[follow] section of Config.
Fields§
§ignore: Vec<String>Inputs to skip during follow analysis.
See Self::is_ignored for the matching rules.
transitive_min: usizeMinimum number of transitive references required before a shared
nested input is promoted to top-level. 0 disables transitive
deduplication.
aliases: HashMap<String, Vec<String>>Alias mappings: canonical name to alternative names. For example,
nixpkgs = ["nixpkgs-lib"] lets nixpkgs-lib follow nixpkgs.
max_depth: Option<usize>Maximum depth of follows declarations to write.
None (the default) writes follows at every depth the lockfile graph
supports. Some(n) caps the depth: Some(1) writes only
parent.nested.follows = "target", Some(2) also writes deeper paths
such as parent.middle.grandchild.follows = "target".
Implementations§
Source§impl FollowConfig
impl FollowConfig
Sourcepub fn is_ignored(&self, path: &str, name: &str) -> bool
pub fn is_ignored(&self, path: &str, name: &str) -> bool
True if the input at path (e.g. crane.nixpkgs) with simple name
(e.g. nixpkgs) is in Self::ignore.
Entries containing a . match the full dotted path. Bare entries
match by name across all parents.
Sourcepub fn resolve_alias(&self, name: &str) -> Option<&str>
pub fn resolve_alias(&self, name: &str) -> Option<&str>
Canonical name name is an alias of, or None if no alias applies.
Sourcepub fn can_follow(&self, nested_name: &str, top_level_name: &str) -> bool
pub fn can_follow(&self, nested_name: &str, top_level_name: &str) -> bool
True if nested_name may follow top_level_name (direct match or via
Self::aliases).
pub fn transitive_min(&self) -> usize
Trait Implementations§
Source§impl Clone for FollowConfig
impl Clone for FollowConfig
Source§fn clone(&self) -> FollowConfig
fn clone(&self) -> FollowConfig
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 FollowConfig
impl Debug for FollowConfig
Source§impl Default for FollowConfig
impl Default for FollowConfig
Source§impl<'de> Deserialize<'de> for FollowConfig
impl<'de> Deserialize<'de> for FollowConfig
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>,
Auto Trait Implementations§
impl Freeze for FollowConfig
impl RefUnwindSafe for FollowConfig
impl Send for FollowConfig
impl Sync for FollowConfig
impl Unpin for FollowConfig
impl UnsafeUnpin for FollowConfig
impl UnwindSafe for FollowConfig
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more