pub struct Param {
pub opts: Option<OptParamsV1>,
pub body: ParamBody,
}Expand description
One param_unit (parser_v1.mly:635-646): an optional ?(l = x, …)
labeled-optional binder bundle, then a ParamBody (a plain
patbot, or a ( pat : τ ) ascribed pattern). Held inside mod ast
(re-exported at super::Param) so the roots that carry param lists
(Expr::Fun/Expr::LetIn/RecClauseV1) reference it without a
boundary Parse-trait cycle. A bare patbot param parses Param { opts: None, body: ParamBody::Pat(_) } directly — the ?-headed
opts Option is tried first, failing on a non-? head with no
token stolen, so an all-plain param list parses unchanged.
Fields§
§opts: Option<OptParamsV1>§body: ParamBodyTrait Implementations§
Source§impl<__SyanMacro_Atom> Parse<__SyanMacro_Atom> for Param
impl<__SyanMacro_Atom> Parse<__SyanMacro_Atom> for Param
Source§type Error = ParseError<<__SyanMacro_Atom as Spanned>::Span>
type Error = ParseError<<__SyanMacro_Atom as Spanned>::Span>
Every error must be convertible to the universal one, so a field’s failure can become the
enclosing type’s failure with no per-field where-predicate. Stating it HERE rather than at
each derived impl is what keeps it out of the obligation graph: a per-field
<FieldTy as Parse<Atom>>::Error: Into<…> predicate re-creates a projection cycle on a
recursive field (E0275), which decycle’s bound-peeling does not break.Source§fn parse_stream<__SyanMacro_S: ParseStream<Atom = __SyanMacro_Atom>>(
__syan_stream: &mut __SyanMacro_S,
) -> Result<Self, Self::Error>
fn parse_stream<__SyanMacro_S: ParseStream<Atom = __SyanMacro_Atom>>( __syan_stream: &mut __SyanMacro_S, ) -> Result<Self, Self::Error>
Parse from a reborrowable stream. Read more
impl StructuralPartialEq for Param
Auto Trait Implementations§
impl Freeze for Param
impl RefUnwindSafe for Param
impl Send for Param
impl Sync for Param
impl Unpin for Param
impl UnsafeUnpin for Param
impl UnwindSafe for Param
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more