Struct ExprGroup

Source
pub struct ExprGroup<E: InnerExpr> { /* private fields */ }
Expand description

Action with Expr of type either Process, Initial or Err.

Implementations§

Source§

impl ExprGroup<ActionExpr>

Source

pub fn new(expr: ActionExpr, action: ActionGroup) -> Self

Creates new ExprGroup<ActionExpr> with given expr and config.

Source

pub fn expr(&self) -> &ActionExpr

Returns inner expression.

Source

pub fn move_type(&self) -> &MoveType

Returns MoveType of inner expr.

Source

pub fn application_type(&self) -> &ApplicationType

Returns ApplicationType of inner expr.

Source

pub fn parse_empty_unit<ResultExpr: Into<ActionExpr> + Clone + Debug>( result_expr: ResultExpr, unit_parser: &impl ParseUnit<ActionGroup>, action_group: &ActionGroup, input: ParseStream<'_>, ) -> UnitResult<ExprGroup<ActionExpr>, ActionGroup>

Source

pub fn parse_single_unit<P: Parse + Clone + Debug, ResultExpr: Into<ActionExpr> + Clone + Debug>( into_expr: impl FnOnce([P; 1]) -> ResultExpr, unit_parser: &impl ParseUnit<ActionGroup>, action_group: &ActionGroup, input: ParseStream<'_>, ) -> UnitResult<ExprGroup<ActionExpr>, ActionGroup>

Source

pub fn parse_single_or_empty_unit<P: Parse + Clone + Debug, ResultExpr: Into<ActionExpr> + Clone + Debug>( into_expr: impl FnOnce(Option<[P; 1]>) -> ResultExpr, unit_parser: &impl ParseUnit<ActionGroup>, action_group: &ActionGroup, input: ParseStream<'_>, ) -> UnitResult<ExprGroup<ActionExpr>, ActionGroup>

Source

pub fn parse_double_unit<P: Parse + Clone + Debug, ResultExpr: Into<ActionExpr> + Clone + Debug>( into_expr: impl FnOnce([P; 2]) -> ResultExpr, unit_parser: &impl ParseUnit<ActionGroup>, action_group: &ActionGroup, input: ParseStream<'_>, ) -> UnitResult<ExprGroup<ActionExpr>, ActionGroup>

Source

pub fn parse_double_or_empty_unit<P: Parse + Clone + Debug, ResultExpr: Into<ActionExpr> + Clone + Debug>( into_expr: impl FnOnce(Option<[P; 2]>) -> ResultExpr, unit_parser: &impl ParseUnit<ActionGroup>, action_group: &ActionGroup, input: ParseStream<'_>, ) -> UnitResult<ExprGroup<ActionExpr>, ActionGroup>

Source

pub fn parse_triple_unit<P: Parse + Clone + Debug, ResultExpr: Into<ActionExpr> + Clone + Debug>( into_expr: impl FnOnce([P; 3]) -> ResultExpr, unit_parser: &impl ParseUnit<ActionGroup>, action_group: &ActionGroup, input: ParseStream<'_>, ) -> UnitResult<ExprGroup<ActionExpr>, ActionGroup>

Source

pub fn parse_triple_or_empty_unit<P: Parse + Clone + Debug, ResultExpr: Into<ActionExpr> + Clone + Debug>( into_expr: impl FnOnce(Option<[P; 3]>) -> ResultExpr, unit_parser: &impl ParseUnit<ActionGroup>, action_group: &ActionGroup, input: ParseStream<'_>, ) -> UnitResult<ExprGroup<ActionExpr>, ActionGroup>

Source

pub fn parse_quatro_unit<P: Parse + Clone + Debug, ResultExpr: Into<ActionExpr> + Clone + Debug>( into_expr: impl FnOnce([P; 4]) -> ResultExpr, unit_parser: &impl ParseUnit<ActionGroup>, action_group: &ActionGroup, input: ParseStream<'_>, ) -> UnitResult<ExprGroup<ActionExpr>, ActionGroup>

Source

pub fn parse_quatro_or_empty_unit<P: Parse + Clone + Debug, ResultExpr: Into<ActionExpr> + Clone + Debug>( into_expr: impl FnOnce(Option<[P; 4]>) -> ResultExpr, unit_parser: &impl ParseUnit<ActionGroup>, action_group: &ActionGroup, input: ParseStream<'_>, ) -> UnitResult<ExprGroup<ActionExpr>, ActionGroup>

Trait Implementations§

Source§

impl<E: Clone + InnerExpr> Clone for ExprGroup<E>

Source§

fn clone(&self) -> ExprGroup<E>

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<E: Debug + InnerExpr> Debug for ExprGroup<E>

Source§

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

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

impl<E: InnerExpr> InnerExpr for ExprGroup<E>

Source§

fn replace_inner_exprs(self, exprs: &[Expr]) -> Option<Self>

Replaces current expr by given Expr if it’s possible, returning Some(Self) with given Expr(s), otherwise returns None.
Source§

fn inner_exprs(&self) -> Option<&[Expr]>

Extracts Expr(s) from given value if applicable.
Source§

fn is_replaceable(&self) -> bool

Checks if expr can be replaced.
Source§

impl<E: PartialEq + InnerExpr> PartialEq for ExprGroup<E>

Source§

fn eq(&self, other: &ExprGroup<E>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<E: Eq + InnerExpr> Eq for ExprGroup<E>

Source§

impl<E: InnerExpr> StructuralPartialEq for ExprGroup<E>

Auto Trait Implementations§

§

impl<E> Freeze for ExprGroup<E>
where E: Freeze,

§

impl<E> RefUnwindSafe for ExprGroup<E>
where E: RefUnwindSafe,

§

impl<E> Send for ExprGroup<E>
where E: Send,

§

impl<E> Sync for ExprGroup<E>
where E: Sync,

§

impl<E> Unpin for ExprGroup<E>
where E: Unpin,

§

impl<E> UnwindSafe for ExprGroup<E>
where E: UnwindSafe,

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