pub struct TypeDecl<P: Phase = Raw> {
pub visibility: BindableVisibility,
pub name: Spanned<StructTypeName>,
pub generic_params: Vec<GenericParam<P>>,
pub body: TypeDeclBody<P>,
}Expand description
Type declaration: required type stubs and tagged-union bodies.
Forms:
- Required type:
type T;— the library requires a type bound from outside; no body at declaration. - Tagged union:
type Maneuver { Impulsive(delta_v: Velocity), Coast } - Record-shaped type:
type Position { Position(x: Length, y: Length) }, a single-variant union whose constructor name matches the type name.
Fields§
§visibility: BindableVisibility§name: Spanned<StructTypeName>§generic_params: Vec<GenericParam<P>>§body: TypeDeclBody<P>Trait Implementations§
Source§impl FormatEquivalent for TypeDecl
impl FormatEquivalent for TypeDecl
Source§fn format_equivalent(&self, other: &Self) -> bool
fn format_equivalent(&self, other: &Self) -> bool
Returns
true if self and other are equivalent up to formatting.Auto Trait Implementations§
impl<P> Freeze for TypeDecl<P>
impl<P> RefUnwindSafe for TypeDecl<P>
impl<P> Send for TypeDecl<P>
impl<P> Sync for TypeDecl<P>
impl<P> Unpin for TypeDecl<P>
impl<P> UnsafeUnpin for TypeDecl<P>
impl<P> UnwindSafe for TypeDecl<P>
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