pub struct DomainBound<P: Phase = Raw> {
pub kind: DomainBoundKind,
pub kind_span: Span,
pub value: Expr<P>,
pub span: Span,
}Expand description
A domain constraint bound on a type expression: min: expr or max: expr.
Used in Type(min: 100 kg, max: 2000 kg) to declare valid value ranges.
Fields§
§kind: DomainBoundKindThe bound kind (min or max).
kind_span: SpanThe span of the keyword (min or max).
value: Expr<P>The bound value expression.
span: SpanTrait Implementations§
Source§impl<P: Clone + Phase> Clone for DomainBound<P>
impl<P: Clone + Phase> Clone for DomainBound<P>
Source§fn clone(&self) -> DomainBound<P>
fn clone(&self) -> DomainBound<P>
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 FormatEquivalent for DomainBound
impl FormatEquivalent for DomainBound
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.Source§impl From<DomainBound> for DomainBound<Desugared>
impl From<DomainBound> for DomainBound<Desugared>
Source§fn from(d: DomainBound<Raw>) -> Self
fn from(d: DomainBound<Raw>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<P> Freeze for DomainBound<P>
impl<P> RefUnwindSafe for DomainBound<P>
impl<P> Send for DomainBound<P>
impl<P> Sync for DomainBound<P>
impl<P> Unpin for DomainBound<P>
impl<P> UnsafeUnpin for DomainBound<P>
impl<P> UnwindSafe for DomainBound<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