pub enum GenericArg<P: Phase = Raw> {
Type(TypeExpr<P>),
Nat(NatExpr),
}Expand description
A generic argument at a call site (turbofish syntax).
eye<3>() has one GenericArg::Nat(NatExpr::Literal(3, ..)).
some_fn<Length>() has one GenericArg::Type(TypeExpr { kind: DimExpr(..), .. }).
Variants§
Type(TypeExpr<P>)
A type expression (for Dim or Index generic params): Length, Maneuver
Nat(NatExpr)
A nat expression (for Nat generic params): 3, N + 1
Implementations§
Trait Implementations§
Source§impl<P: Clone + Phase> Clone for GenericArg<P>
impl<P: Clone + Phase> Clone for GenericArg<P>
Source§fn clone(&self) -> GenericArg<P>
fn clone(&self) -> GenericArg<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 GenericArg
impl FormatEquivalent for GenericArg
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<GenericArg> for GenericArg<Desugared>
impl From<GenericArg> for GenericArg<Desugared>
Source§fn from(g: GenericArg<Raw>) -> Self
fn from(g: GenericArg<Raw>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<P> Freeze for GenericArg<P>
impl<P> RefUnwindSafe for GenericArg<P>
impl<P> Send for GenericArg<P>
impl<P> Sync for GenericArg<P>
impl<P> Unpin for GenericArg<P>
impl<P> UnsafeUnpin for GenericArg<P>
impl<P> UnwindSafe for GenericArg<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