Struct nu_protocol::ast::Expression
source · [−]pub struct Expression {
pub expr: Expr,
pub span: Span,
pub ty: Type,
pub custom_completion: Option<DeclId>,
}Fields
expr: Exprspan: Spanty: Typecustom_completion: Option<DeclId>Implementations
sourceimpl Expression
impl Expression
pub fn garbage(span: Span) -> Expression
pub fn precedence(&self) -> usize
pub fn as_block(&self) -> Option<BlockId>
pub fn as_row_condition_block(&self) -> Option<BlockId>
pub fn as_signature(&self) -> Option<Box<Signature>>
pub fn as_list(&self) -> Option<Vec<Expression>>
pub fn as_keyword(&self) -> Option<&Expression>
pub fn as_var(&self) -> Option<VarId>
pub fn as_string(&self) -> Option<String>
pub fn as_import_pattern(&self) -> Option<ImportPattern>
pub fn has_in_variable(&self, working_set: &StateWorkingSet<'_>) -> bool
pub fn replace_in_variable(
&mut self,
working_set: &mut StateWorkingSet<'_>,
new_var_id: VarId
)
pub fn replace_span(
&mut self,
working_set: &mut StateWorkingSet<'_>,
replaced: Span,
new_span: Span
)
Trait Implementations
sourceimpl Clone for Expression
impl Clone for Expression
sourcefn clone(&self) -> Expression
fn clone(&self) -> Expression
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for Expression
impl Debug for Expression
sourceimpl<'de> Deserialize<'de> for Expression
impl<'de> Deserialize<'de> for Expression
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl PartialEq<Expression> for Expression
impl PartialEq<Expression> for Expression
sourcefn eq(&self, other: &Expression) -> bool
fn eq(&self, other: &Expression) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &Expression) -> bool
fn ne(&self, other: &Expression) -> bool
This method tests for !=.
sourceimpl Serialize for Expression
impl Serialize for Expression
impl StructuralPartialEq for Expression
Auto Trait Implementations
impl RefUnwindSafe for Expression
impl Send for Expression
impl Sync for Expression
impl Unpin for Expression
impl UnwindSafe for Expression
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Serialize for T where
T: Serialize + ?Sized,
impl<T> Serialize for T where
T: Serialize + ?Sized,
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<Ok, Error>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more