#[non_exhaustive]pub enum Generic {
Lifetime(Lifetime),
Generic(SimpleGeneric),
Const(ConstGeneric),
}
Expand description
A single generic argument on a type
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Lifetime(Lifetime)
A lifetime generic
struct Foo<'a> { // will be Generic::Lifetime("a")
}
Generic(SimpleGeneric)
A simple generic
struct Foo<F> { // will be Generic::Generic("F")
}
Const(ConstGeneric)
A const generic
struct Foo<const N: usize> { // will be Generic::Const("N")
}
Trait Implementations§
source§impl From<ConstGeneric> for Generic
impl From<ConstGeneric> for Generic
source§fn from(gen: ConstGeneric) -> Self
fn from(gen: ConstGeneric) -> Self
Converts to this type from the input type.
source§impl From<SimpleGeneric> for Generic
impl From<SimpleGeneric> for Generic
source§fn from(gen: SimpleGeneric) -> Self
fn from(gen: SimpleGeneric) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Generic
impl RefUnwindSafe for Generic
impl !Send for Generic
impl !Sync for Generic
impl Unpin for Generic
impl UnwindSafe for Generic
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