pub enum TypeBodyV1 {
Variant {
leading_bar: Option<BarTok>,
first: VariantDefV1,
rest: Vec<BarVariantDefV1>,
},
Synonym(TypeExpr),
}Expand description
The right-hand side of one type bind: a variant’s constructor list
(EXACT_EQ BAR? variants, parser_v1.mly:540-541,545-553) or a
transparent synonym (EXACT_EQ typ, :542-543). Variant-first is
unambiguous for the same reason as crate::cst::TypeDeclBody
(cst.rs:410-418): a variant list is BarTok/CtorTok-headed and no
ast::TypeExpr can start with either.
Variants§
Trait Implementations§
Source§impl Clone for TypeBodyV1
impl Clone for TypeBodyV1
Source§fn clone(&self) -> TypeBodyV1
fn clone(&self) -> TypeBodyV1
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TypeBodyV1
impl Debug for TypeBodyV1
Source§impl<__SyanMacro_Atom> Parse<__SyanMacro_Atom> for TypeBodyV1
impl<__SyanMacro_Atom> Parse<__SyanMacro_Atom> for TypeBodyV1
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
Source§impl PartialEq for TypeBodyV1
impl PartialEq for TypeBodyV1
impl StructuralPartialEq for TypeBodyV1
Source§impl<__SyanMacro_Atom> Unparse<__SyanMacro_Atom> for TypeBodyV1where
Option<BarTok>: Unparse<__SyanMacro_Atom>,
VariantDefV1: Unparse<__SyanMacro_Atom>,
Vec<BarVariantDefV1>: Unparse<__SyanMacro_Atom>,
TypeExpr: Unparse<__SyanMacro_Atom>,
impl<__SyanMacro_Atom> Unparse<__SyanMacro_Atom> for TypeBodyV1where
Option<BarTok>: Unparse<__SyanMacro_Atom>,
VariantDefV1: Unparse<__SyanMacro_Atom>,
Vec<BarVariantDefV1>: Unparse<__SyanMacro_Atom>,
TypeExpr: Unparse<__SyanMacro_Atom>,
Auto Trait Implementations§
impl Freeze for TypeBodyV1
impl RefUnwindSafe for TypeBodyV1
impl Send for TypeBodyV1
impl Sync for TypeBodyV1
impl Unpin for TypeBodyV1
impl UnsafeUnpin for TypeBodyV1
impl UnwindSafe for TypeBodyV1
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