pub struct TypeExpr<P: Phase = Raw> {
pub kind: TypeExprKind<P>,
pub constraints: Vec<DomainBound<P>>,
pub span: Span,
}Expand description
E.g., Length, Dimensionless, Length^3 / Time^2
Optionally carries domain constraints: Mass(min: 100 kg, max: 2000 kg).
Fields§
§kind: TypeExprKind<P>§constraints: Vec<DomainBound<P>>Optional domain constraints on the type.
span: SpanImplementations§
Source§impl<P: Phase> TypeExpr<P>
impl<P: Phase> TypeExpr<P>
Sourcepub fn domain_bounds(&self) -> &[DomainBound<P>]
pub fn domain_bounds(&self) -> &[DomainBound<P>]
The domain bounds attached to this type expression.
Bounds on an indexed type (Velocity[Maneuver](min: 0.0 m/s)) are
parsed onto the base type expression, so this looks through one
Indexed wrapper when the outer expression carries none.
Trait Implementations§
Source§impl FormatEquivalent for TypeExpr
impl FormatEquivalent for TypeExpr
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 TypeExpr<P>
impl<P> RefUnwindSafe for TypeExpr<P>
impl<P> Send for TypeExpr<P>
impl<P> Sync for TypeExpr<P>
impl<P> Unpin for TypeExpr<P>
impl<P> UnsafeUnpin for TypeExpr<P>
impl<P> UnwindSafe for TypeExpr<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