pub struct AttrPath(/* private fields */);Implementations§
Source§impl AttrPath
impl AttrPath
pub fn new(first: Segment) -> Self
Sourcepub fn parse(s: &str) -> Result<Self, AttrPathParseError>
pub fn parse(s: &str) -> Result<Self, AttrPathParseError>
Parse a dotted path, respecting "..." quoting on individual segments.
Examples:
nixpkgs→ 1 segment.crane.nixpkgs→ 2 segments."hls-1.10".nixpkgs→ 2 segments, the first stored unquoted.a."b.c".d→ 3 segments.
pub fn first(&self) -> &Segment
pub fn last(&self) -> &Segment
pub fn len(&self) -> usize
pub fn segments(&self) -> &[Segment]
Sourcepub fn parent(&self) -> Option<AttrPath>
pub fn parent(&self) -> Option<AttrPath>
All segments except the last, or None for a length-1 path.
pub fn push(&mut self, seg: Segment)
Sourcepub fn to_flake_follows_string(&self) -> String
pub fn to_flake_follows_string(&self) -> String
Render for the RHS of follows = "...". Display emits the
LHS attribute-path form and injects per-segment quoting that
is invalid in this string-value position.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for AttrPath
impl<'de> Deserialize<'de> for AttrPath
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl Eq for AttrPath
Source§impl Ord for AttrPath
impl Ord for AttrPath
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for AttrPath
impl PartialOrd for AttrPath
impl StructuralPartialEq for AttrPath
Auto Trait Implementations§
impl Freeze for AttrPath
impl RefUnwindSafe for AttrPath
impl Send for AttrPath
impl Sync for AttrPath
impl Unpin for AttrPath
impl UnsafeUnpin for AttrPath
impl UnwindSafe for AttrPath
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> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.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 moreSource§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more