#[repr(transparent)]pub struct NixAttrs(pub(super) Rc<AttrsRep>);
Tuple Fields§
§0: Rc<AttrsRep>
Implementations§
source§impl NixAttrs
impl NixAttrs
pub fn empty() -> Self
sourcepub fn ptr_eq(&self, other: &Self) -> bool
pub fn ptr_eq(&self, other: &Self) -> bool
Compare two attribute sets by pointer equality. Only makes
sense for some attribute set representations, i.e. returning
false
does not mean that the two attribute sets do not have
equal content.
sourcepub fn update(self, other: Self) -> Self
pub fn update(self, other: Self) -> Self
Return an attribute set containing the merge of the two
provided sets. Keys from the other
set have precedence.
pub fn is_empty(&self) -> bool
sourcepub fn select<K>(&self, key: &K) -> Option<&Value>
pub fn select<K>(&self, key: &K) -> Option<&Value>
Select a value from an attribute set by key.
sourcepub fn select_required<K>(&self, key: &K) -> Result<&Value, ErrorKind>
pub fn select_required<K>(&self, key: &K) -> Result<&Value, ErrorKind>
Select a required value from an attribute set by key, return
an AttributeNotFound
error if it is missing.
pub fn contains<'a, K: 'a>(&self, key: K) -> bool
sourcepub fn iter<'a>(&'a self) -> Iter<KeyValue<'a>> ⓘ
pub fn iter<'a>(&'a self) -> Iter<KeyValue<'a>> ⓘ
Construct an iterator over all the key-value pairs in the attribute set.
sourcepub fn iter_sorted(&self) -> Iter<KeyValue<'_>> ⓘ
pub fn iter_sorted(&self) -> Iter<KeyValue<'_>> ⓘ
Same as iter(), but marks call sites which rely on the iteration being lexicographic.
sourcepub fn into_iter_sorted(self) -> OwnedAttrsIterator ⓘ
pub fn into_iter_sorted(self) -> OwnedAttrsIterator ⓘ
Same as IntoIterator::into_iter, but marks call sites which rely on the iteration being lexicographic.
Trait Implementations§
source§impl Arbitrary for NixAttrs
impl Arbitrary for NixAttrs
§type Parameters = Parameters
type Parameters = Parameters
The type of parameters that
arbitrary_with
accepts for configuration
of the generated Strategy
. Parameters must implement Default
.§type Strategy = BoxedStrategy<NixAttrs>
type Strategy = BoxedStrategy<NixAttrs>
The type of
Strategy
used to generate values of type Self
.source§fn arbitrary_with(args: Self::Parameters) -> Self::Strategy
fn arbitrary_with(args: Self::Parameters) -> Self::Strategy
source§impl<'de> Deserialize<'de> for NixAttrs
impl<'de> Deserialize<'de> for NixAttrs
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
source§impl<K, V> FromIterator<(K, V)> for NixAttrs
impl<K, V> FromIterator<(K, V)> for NixAttrs
source§impl<'a> IntoIterator for &'a NixAttrs
impl<'a> IntoIterator for &'a NixAttrs
source§impl IntoIterator for NixAttrs
impl IntoIterator for NixAttrs
Auto Trait Implementations§
impl Freeze for NixAttrs
impl !RefUnwindSafe for NixAttrs
impl !Send for NixAttrs
impl !Sync for NixAttrs
impl Unpin for NixAttrs
impl !UnwindSafe for NixAttrs
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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