pub struct Binding {
pub name: Ident,
pub decl_node: SyntaxNode<NixLanguage>,
/* private fields */
}
Expand description
A Nix variable binding
Fields§
§name: Ident
Variable name
decl_node: SyntaxNode<NixLanguage>
Syntax node of declaration itself
Implementations§
source§impl Binding
impl Binding
sourcepub fn new(
name: Ident,
decl_node: SyntaxNode<NixLanguage>,
mortal: bool
) -> Self
pub fn new( name: Ident, decl_node: SyntaxNode<NixLanguage>, mortal: bool ) -> Self
Create a new Binding
sourcepub fn is_mortal(&self) -> bool
pub fn is_mortal(&self) -> bool
Can die?
Not mortal are rec { ... }
, and lambda args that already
start with _
.
sourcepub fn starts_with_underscore(&self) -> bool
pub fn starts_with_underscore(&self) -> bool
Does the name start with _
, signifying an anonymous
variable?
sourcepub fn has_pragma_skip(&self) -> bool
pub fn has_pragma_skip(&self) -> bool
Searches through tokens backwards for PRAGMA_SKIP
until at
least two linebreaks are seen
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Binding
impl !Send for Binding
impl !Sync for Binding
impl Unpin for Binding
impl !UnwindSafe for Binding
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