pub struct ArgAttrs<'a> { /* private fields */ }Expand description
A borrowed Nix attribute set value.
Obtained from PrimOpArg::as_attrs or PrimOpValue::as_attrs.
Provides read access to the attribute set without owning any GC
references itself.
Implementations§
Source§impl<'a> ArgAttrs<'a>
impl<'a> ArgAttrs<'a>
Sourcepub fn get(&self, key: &str) -> Result<PrimOpValue<'a>>
pub fn get(&self, key: &str) -> Result<PrimOpValue<'a>>
Get an attribute by name.
Returns an owned PrimOpValue that holds a GC reference to the
attribute’s value. The caller is responsible for the GC reference;
PrimOpValue releases it on drop. The value carries the same
callback-frame lifetime as this attribute-set wrapper.
§Errors
Returns Error::KeyNotFound if the key does not exist.
Sourcepub fn has(&self, key: &str) -> Result<bool>
pub fn has(&self, key: &str) -> Result<bool>
Check if an attribute exists.
§Errors
Returns an error if the lookup itself fails (not if the key is absent).
Auto Trait Implementations§
impl<'a> Freeze for ArgAttrs<'a>
impl<'a> RefUnwindSafe for ArgAttrs<'a>
impl<'a> !Send for ArgAttrs<'a>
impl<'a> !Sync for ArgAttrs<'a>
impl<'a> Unpin for ArgAttrs<'a>
impl<'a> UnsafeUnpin for ArgAttrs<'a>
impl<'a> UnwindSafe for ArgAttrs<'a>
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