Struct nu_protocol::hir::SpannedExpression
source · [−]pub struct SpannedExpression {
pub expr: Expression,
pub span: Span,
}
Fields
expr: Expression
span: Span
Implementations
sourceimpl SpannedExpression
impl SpannedExpression
pub fn new(expr: Expression, span: Span) -> SpannedExpression
pub fn precedence(&self) -> usize
pub fn has_var_usage(&self, var_name: &str) -> bool
pub fn get_free_variables(
&self,
known_variables: &mut Vec<String>
) -> Vec<String>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
pub fn var_name(&self) -> Result<String, ShellError>
Methods from Deref<Target = Expression>
pub fn has_var_usage(&self, var_name: &str) -> bool
pub fn get_free_variables(
&self,
known_variables: &mut Vec<String>
) -> Vec<String>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Trait Implementations
sourceimpl Clone for SpannedExpression
impl Clone for SpannedExpression
sourcefn clone(&self) -> SpannedExpression
fn clone(&self) -> SpannedExpression
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 SpannedExpression
impl Debug for SpannedExpression
sourceimpl Deref for SpannedExpression
impl Deref for SpannedExpression
type Target = Expression
type Target = Expression
The resulting type after dereferencing.
sourcefn deref(&self) -> &Expression
fn deref(&self) -> &Expression
Dereferences the value.
sourceimpl<'de> Deserialize<'de> for SpannedExpression
impl<'de> Deserialize<'de> for SpannedExpression
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 Hash for SpannedExpression
impl Hash for SpannedExpression
sourceimpl Ord for SpannedExpression
impl Ord for SpannedExpression
sourceimpl PartialEq<SpannedExpression> for SpannedExpression
impl PartialEq<SpannedExpression> for SpannedExpression
sourcefn eq(&self, other: &SpannedExpression) -> bool
fn eq(&self, other: &SpannedExpression) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &SpannedExpression) -> bool
fn ne(&self, other: &SpannedExpression) -> bool
This method tests for !=
.
sourceimpl PartialOrd<SpannedExpression> for SpannedExpression
impl PartialOrd<SpannedExpression> for SpannedExpression
sourcefn partial_cmp(&self, other: &SpannedExpression) -> Option<Ordering>
fn partial_cmp(&self, other: &SpannedExpression) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl PrettyDebugWithSource for SpannedExpression
impl PrettyDebugWithSource for SpannedExpression
fn refined_pretty_debug(
&self,
refine: PrettyDebugRefineKind,
source: &str
) -> DebugDocBuilder
fn pretty_debug(&self, source: &str) -> DebugDocBuilder
fn debug(&self, source: impl Into<Text>) -> String where
Self: Clone,
fn debuggable(self, source: impl Into<Text>) -> DebuggableWithSource<Self>
sourceimpl Serialize for SpannedExpression
impl Serialize for SpannedExpression
sourceimpl ShellTypeName for SpannedExpression
impl ShellTypeName for SpannedExpression
impl Eq for SpannedExpression
impl StructuralEq for SpannedExpression
impl StructuralPartialEq for SpannedExpression
Auto Trait Implementations
impl RefUnwindSafe for SpannedExpression
impl Send for SpannedExpression
impl Sync for SpannedExpression
impl Unpin for SpannedExpression
impl UnwindSafe for SpannedExpression
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcepub fn equivalent(&self, key: &K) -> bool
pub fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
sourceimpl<T> HasFallibleSpan for T where
T: HasSpan,
impl<T> HasFallibleSpan for T where
T: HasSpan,
pub fn maybe_span(&self) -> Option<Span>
sourceimpl<T> IntoSpanned for T where
T: HasFallibleSpan,
impl<T> IntoSpanned for T where
T: HasFallibleSpan,
type Output = T
pub fn into_spanned(self, _span: impl Into<Span>) -> <T as IntoSpanned>::Output
sourceimpl<T> SpannedItem for T
impl<T> SpannedItem for T
sourceimpl<T> TaggedItem for T
impl<T> TaggedItem for T
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.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more