Enum rnix::ast::Expr

source ·
pub enum Expr {
Show 20 variants Apply(Apply), Assert(Assert), Error(Error), IfElse(IfElse), Select(Select), Str(Str), Path(Path), Literal(Literal), Lambda(Lambda), LegacyLet(LegacyLet), LetIn(LetIn), List(List), BinOp(BinOp), Paren(Paren), Root(Root), AttrSet(AttrSet), UnaryOp(UnaryOp), Ident(Ident), With(With), HasAttr(HasAttr),
}
Expand description

An expression. The fundamental nix ast type.

Variants§

§

Apply(Apply)

§

Assert(Assert)

§

Error(Error)

§

IfElse(IfElse)

§

Select(Select)

§

Str(Str)

§

Path(Path)

§

Literal(Literal)

§

Lambda(Lambda)

§

LegacyLet(LegacyLet)

§

LetIn(LetIn)

§

List(List)

§

BinOp(BinOp)

§

Paren(Paren)

§

Root(Root)

§

AttrSet(AttrSet)

§

UnaryOp(UnaryOp)

§

Ident(Ident)

§

With(With)

§

HasAttr(HasAttr)

Trait Implementations§

source§

impl AstNode for Expr

§

type Language = NixLanguage

source§

fn can_cast(kind: SyntaxKind) -> bool

source§

fn cast(syntax: SyntaxNode) -> Option<Self>

source§

fn syntax(&self) -> &SyntaxNode

source§

fn clone_for_update(&self) -> Self
where Self: Sized,

source§

fn clone_subtree(&self) -> Self
where Self: Sized,

source§

impl Clone for Expr

source§

fn clone(&self) -> Expr

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Expr

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Expr

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<Apply> for Expr

source§

fn from(node: Apply) -> Expr

Converts to this type from the input type.
source§

impl From<Assert> for Expr

source§

fn from(node: Assert) -> Expr

Converts to this type from the input type.
source§

impl From<AttrSet> for Expr

source§

fn from(node: AttrSet) -> Expr

Converts to this type from the input type.
source§

impl From<BinOp> for Expr

source§

fn from(node: BinOp) -> Expr

Converts to this type from the input type.
source§

impl From<Error> for Expr

source§

fn from(node: Error) -> Expr

Converts to this type from the input type.
source§

impl From<HasAttr> for Expr

source§

fn from(node: HasAttr) -> Expr

Converts to this type from the input type.
source§

impl From<Ident> for Expr

source§

fn from(node: Ident) -> Expr

Converts to this type from the input type.
source§

impl From<IfElse> for Expr

source§

fn from(node: IfElse) -> Expr

Converts to this type from the input type.
source§

impl From<Lambda> for Expr

source§

fn from(node: Lambda) -> Expr

Converts to this type from the input type.
source§

impl From<LegacyLet> for Expr

source§

fn from(node: LegacyLet) -> Expr

Converts to this type from the input type.
source§

impl From<LetIn> for Expr

source§

fn from(node: LetIn) -> Expr

Converts to this type from the input type.
source§

impl From<List> for Expr

source§

fn from(node: List) -> Expr

Converts to this type from the input type.
source§

impl From<Literal> for Expr

source§

fn from(node: Literal) -> Expr

Converts to this type from the input type.
source§

impl From<Paren> for Expr

source§

fn from(node: Paren) -> Expr

Converts to this type from the input type.
source§

impl From<Path> for Expr

source§

fn from(node: Path) -> Expr

Converts to this type from the input type.
source§

impl From<Root> for Expr

source§

fn from(node: Root) -> Expr

Converts to this type from the input type.
source§

impl From<Select> for Expr

source§

fn from(node: Select) -> Expr

Converts to this type from the input type.
source§

impl From<Str> for Expr

source§

fn from(node: Str) -> Expr

Converts to this type from the input type.
source§

impl From<UnaryOp> for Expr

source§

fn from(node: UnaryOp) -> Expr

Converts to this type from the input type.
source§

impl From<With> for Expr

source§

fn from(node: With) -> Expr

Converts to this type from the input type.
source§

impl Hash for Expr

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for Expr

source§

fn eq(&self, other: &Expr) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl TryFrom<Expr> for Apply

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(node: Expr) -> Result<Apply, ()>

Performs the conversion.
source§

impl TryFrom<Expr> for Assert

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(node: Expr) -> Result<Assert, ()>

Performs the conversion.
source§

impl TryFrom<Expr> for AttrSet

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(node: Expr) -> Result<AttrSet, ()>

Performs the conversion.
source§

impl TryFrom<Expr> for BinOp

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(node: Expr) -> Result<BinOp, ()>

Performs the conversion.
source§

impl TryFrom<Expr> for Error

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(node: Expr) -> Result<Error, ()>

Performs the conversion.
source§

impl TryFrom<Expr> for HasAttr

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(node: Expr) -> Result<HasAttr, ()>

Performs the conversion.
source§

impl TryFrom<Expr> for Ident

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(node: Expr) -> Result<Ident, ()>

Performs the conversion.
source§

impl TryFrom<Expr> for IfElse

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(node: Expr) -> Result<IfElse, ()>

Performs the conversion.
source§

impl TryFrom<Expr> for Lambda

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(node: Expr) -> Result<Lambda, ()>

Performs the conversion.
source§

impl TryFrom<Expr> for LegacyLet

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(node: Expr) -> Result<LegacyLet, ()>

Performs the conversion.
source§

impl TryFrom<Expr> for LetIn

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(node: Expr) -> Result<LetIn, ()>

Performs the conversion.
source§

impl TryFrom<Expr> for List

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(node: Expr) -> Result<List, ()>

Performs the conversion.
source§

impl TryFrom<Expr> for Literal

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(node: Expr) -> Result<Literal, ()>

Performs the conversion.
source§

impl TryFrom<Expr> for Paren

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(node: Expr) -> Result<Paren, ()>

Performs the conversion.
source§

impl TryFrom<Expr> for Path

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(node: Expr) -> Result<Path, ()>

Performs the conversion.
source§

impl TryFrom<Expr> for Root

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(node: Expr) -> Result<Root, ()>

Performs the conversion.
source§

impl TryFrom<Expr> for Select

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(node: Expr) -> Result<Select, ()>

Performs the conversion.
source§

impl TryFrom<Expr> for Str

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(node: Expr) -> Result<Str, ()>

Performs the conversion.
source§

impl TryFrom<Expr> for UnaryOp

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(node: Expr) -> Result<UnaryOp, ()>

Performs the conversion.
source§

impl TryFrom<Expr> for With

§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(node: Expr) -> Result<With, ()>

Performs the conversion.
source§

impl Eq for Expr

source§

impl StructuralPartialEq for Expr

Auto Trait Implementations§

§

impl Freeze for Expr

§

impl !RefUnwindSafe for Expr

§

impl !Send for Expr

§

impl !Sync for Expr

§

impl Unpin for Expr

§

impl !UnwindSafe for Expr

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> AstNode for T
where T: AstNode<Language = NixLanguage>,