pub enum NixPattern {
Ident(String),
AttrPattern {
attrs: Vec<(String, Option<NixExpr>)>,
ellipsis: bool,
},
AtPattern {
ident: String,
ident_first: bool,
attrs: Vec<(String, Option<NixExpr>)>,
ellipsis: bool,
},
}Expand description
Function argument pattern in Nix.
Variants§
Ident(String)
Simple identifier pattern: x: body
AttrPattern
Attribute set pattern: { a, b, c ? default, ... }: body
Fields
AtPattern
At-pattern combining set destructuring with a binding:
{ a, b } @ pkg: body (or pkg @ { a, b }: body)
Trait Implementations§
Source§impl Clone for NixPattern
impl Clone for NixPattern
Source§fn clone(&self) -> NixPattern
fn clone(&self) -> NixPattern
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 NixPattern
impl Debug for NixPattern
Source§impl PartialEq for NixPattern
impl PartialEq for NixPattern
impl StructuralPartialEq for NixPattern
Auto Trait Implementations§
impl Freeze for NixPattern
impl RefUnwindSafe for NixPattern
impl Send for NixPattern
impl Sync for NixPattern
impl Unpin for NixPattern
impl UnsafeUnpin for NixPattern
impl UnwindSafe for NixPattern
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