pub struct FollowAutoConfig {
pub ignore: Vec<String>,
pub aliases: HashMap<String, Vec<String>>,
}Expand description
Configuration for follow --auto behavior.
Fields§
§ignore: Vec<String>Inputs to ignore during auto-follow.
aliases: HashMap<String, Vec<String>>Alias mappings: canonical_name -> [alternative_names] e.g., nixpkgs = [“nixpkgs-lib”] means nixpkgs-lib can follow nixpkgs
Implementations§
Source§impl FollowAutoConfig
impl FollowAutoConfig
Sourcepub fn is_ignored(&self, path: &str, name: &str) -> bool
pub fn is_ignored(&self, path: &str, name: &str) -> bool
Check if an input should be ignored.
Supports two formats:
- Full path:
"crane.nixpkgs"- ignores only that specific nested input - Simple name:
"nixpkgs"- ignores all nested inputs with that name
Sourcepub fn resolve_alias(&self, name: &str) -> Option<&str>
pub fn resolve_alias(&self, name: &str) -> Option<&str>
Find the canonical name for a given input name. Returns the canonical name if found in aliases, otherwise returns None.
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
Check if nested_name can follow top_level_name.
Returns true if they match directly or via alias.
Trait Implementations§
Source§impl Clone for FollowAutoConfig
impl Clone for FollowAutoConfig
Source§fn clone(&self) -> FollowAutoConfig
fn clone(&self) -> FollowAutoConfig
Returns a duplicate of the value. Read more
1.0.0 · 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 FollowAutoConfig
impl Debug for FollowAutoConfig
Source§impl Default for FollowAutoConfig
impl Default for FollowAutoConfig
Source§fn default() -> FollowAutoConfig
fn default() -> FollowAutoConfig
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for FollowAutoConfig
impl<'de> Deserialize<'de> for FollowAutoConfig
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for FollowAutoConfig
impl RefUnwindSafe for FollowAutoConfig
impl Send for FollowAutoConfig
impl Sync for FollowAutoConfig
impl Unpin for FollowAutoConfig
impl UnwindSafe for FollowAutoConfig
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<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>
Converts
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>
Converts
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