StmtP

Enum StmtP 

Source
pub enum StmtP<P>
where P: AstPayload,
{
Show 16 variants Break, Continue, Pass, Return(Option<Spanned<ExprP<P>>>), Yield(Option<Spanned<ExprP<P>>>), Expression(Spanned<ExprP<P>>), Assign(AssignP<P>), AssignModify(Spanned<AssignTargetP<P>>, AssignOp, Box<Spanned<ExprP<P>>>), Statements(Vec<Spanned<StmtP<P>>>), If(Spanned<ExprP<P>>, Box<Spanned<StmtP<P>>>), IfElse(Spanned<ExprP<P>>, Box<(Spanned<StmtP<P>>, Spanned<StmtP<P>>)>), For(ForP<P>), Def(DefP<P>), Load(LoadP<P>), Struct(StructP<P>), Match(MatchP<P>),
}

Variants§

§

Break

§

Continue

§

Pass

§

Return(Option<Spanned<ExprP<P>>>)

§

Yield(Option<Spanned<ExprP<P>>>)

§

Expression(Spanned<ExprP<P>>)

§

Assign(AssignP<P>)

§

AssignModify(Spanned<AssignTargetP<P>>, AssignOp, Box<Spanned<ExprP<P>>>)

§

Statements(Vec<Spanned<StmtP<P>>>)

§

If(Spanned<ExprP<P>>, Box<Spanned<StmtP<P>>>)

§

IfElse(Spanned<ExprP<P>>, Box<(Spanned<StmtP<P>>, Spanned<StmtP<P>>)>)

§

For(ForP<P>)

§

Def(DefP<P>)

§

Load(LoadP<P>)

§

Struct(StructP<P>)

§

Match(MatchP<P>)

Implementations§

Source§

impl<A> StmtP<A>
where A: AstPayload,

Source

pub fn into_map_payload<B>( self, f: &mut impl AstPayloadFunction<A, B>, ) -> StmtP<B>
where B: AstPayload,

Source§

impl<P> StmtP<P>
where P: AstPayload,

Source

pub fn visit_children<'a>(&'a self, f: impl FnMut(Visit<'a, P>))

Source

pub fn visit_children_mut<'a>(&'a mut self, f: impl FnMut(VisitMut<'a, P>))

Source

pub fn visit_children_err<'a, E>( &'a self, f: impl FnMut(Visit<'a, P>) -> Result<(), E>, ) -> Result<(), E>

Source

pub fn visit_children_err_mut<'a, E>( &'a mut self, f: impl FnMut(VisitMut<'a, P>) -> Result<(), E>, ) -> Result<(), E>

Source

pub fn visit_stmt<'a>(&'a self, f: impl FnMut(&'a Spanned<StmtP<P>>))

Source

pub fn visit_stmt_mut<'a>( &'a mut self, f: impl FnMut(&'a mut Spanned<StmtP<P>>), )

Source

pub fn visit_expr<'a>(&'a self, f: impl FnMut(&'a Spanned<ExprP<P>>))

Source

pub fn visit_expr_mut<'a>( &'a mut self, f: impl FnMut(&'a mut Spanned<ExprP<P>>), )

Source

pub fn visit_expr_result<'a, E>( &'a self, f: impl FnMut(&'a Spanned<ExprP<P>>) -> Result<(), E>, ) -> Result<(), E>

Source

pub fn visit_stmt_result<E>( &self, f: impl FnMut(&Spanned<StmtP<P>>) -> Result<(), E>, ) -> Result<(), E>

Source

pub fn visit_type_expr_err_mut<E>( &mut self, f: &mut impl FnMut(&mut Spanned<TypeExprP<P>>) -> Result<(), E>, ) -> Result<(), E>

Visit all type expressions in this statement and its children.

Source

pub fn visit_ident<E>( &self, f: impl FnMut(&Spanned<IdentP<P>>) -> Result<(), E>, ) -> Result<(), E>

Visit all identifiers in read position recursively.

Trait Implementations§

Source§

impl<P> Clone for StmtP<P>
where P: Clone + AstPayload,

Source§

fn clone(&self) -> StmtP<P>

Returns a duplicate 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<P> Debug for StmtP<P>
where P: Debug + AstPayload,

Source§

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

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

impl Display for StmtP<AstNoPayload>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<P> Freeze for StmtP<P>

§

impl<P> RefUnwindSafe for StmtP<P>

§

impl<P> Send for StmtP<P>

§

impl<P> Sync for StmtP<P>

§

impl<P> Unpin for StmtP<P>

§

impl<P> UnwindSafe for StmtP<P>

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<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToAst for T

Source§

fn ast(self, begin: usize, end: usize) -> Spanned<Self>

Source§

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

Source§

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§

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>,

Source§

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>,

Source§

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.