pub struct ArgList<'a> { /* private fields */ }Expand description
A borrowed Nix list value.
Obtained from PrimOpArg::as_list or PrimOpValue::as_list.
Provides read access to the list without owning any GC references
itself.
Implementations§
Source§impl<'a> ArgList<'a>
impl<'a> ArgList<'a>
Sourcepub fn get(&self, index: usize) -> Result<PrimOpValue<'a>>
pub fn get(&self, index: usize) -> Result<PrimOpValue<'a>>
Get an element by index.
Returns an owned PrimOpValue that holds a GC reference to the
element. The caller is responsible for the GC reference;
PrimOpValue releases it on drop. The value carries the same
callback-frame lifetime as this list wrapper.
§Errors
Returns Error::IndexOutOfBounds if index >= self.len().
Auto Trait Implementations§
impl<'a> Freeze for ArgList<'a>
impl<'a> RefUnwindSafe for ArgList<'a>
impl<'a> !Send for ArgList<'a>
impl<'a> !Sync for ArgList<'a>
impl<'a> Unpin for ArgList<'a>
impl<'a> UnsafeUnpin for ArgList<'a>
impl<'a> UnwindSafe for ArgList<'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