#[non_exhaustive]pub enum Type {
Path(Path),
Bang(Bang),
Tuple(Parenthesized<Box<Type>, Comma>),
}Expand description
A type, used for static typing.
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.
Path(Path)
If the type is an identifier or a path.
Bang(Bang)
If the type should return nothing (a.k.a the “never” type in Rust).
Tuple(Parenthesized<Box<Type>, Comma>)
If the type is a tuple.
Trait Implementations§
impl Eq for Type
Source§impl OptionSpanned for Type
impl OptionSpanned for Type
Source§fn option_span(&self) -> Option<Span>
fn option_span(&self) -> Option<Span>
Get the optional span of the type.
impl StructuralPartialEq for Type
Auto Trait Implementations§
impl Forget for Type
impl Freeze for Typewhere
*const (PathSegmentExpr, Option<Comma>) is !null: Freeze,
PhantomData<(PathSegmentExpr, Option<Comma>)>: Freeze,
*const (ColonColon, PathSegment) is !null: Freeze,
PhantomData<(ColonColon, PathSegment)>: Freeze,
*const (Box<Type>, Option<Comma>) is !null: Freeze,
PhantomData<(Box<Type>, Option<Comma>)>: Freeze,
impl Move for Type
impl RefUnwindSafe for Type
impl Send for Typewhere
Unique<(PathSegmentExpr, Option<Comma>)>: Send,
Unique<(ColonColon, PathSegment)>: Send,
Unique<(Box<Type>, Option<Comma>)>: Send,
impl Sync for Typewhere
Unique<(PathSegmentExpr, Option<Comma>)>: Sync,
Unique<(ColonColon, PathSegment)>: Sync,
Unique<(Box<Type>, Option<Comma>)>: Sync,
impl Unpin for Typewhere
*const (PathSegmentExpr, Option<Comma>) is !null: Unpin,
*const Attribute is !null: Unpin,
*const Token is !null: Unpin,
NonZero<u32>: Unpin,
Box<Expr>: Unpin,
Box<Condition>: Unpin,
Box<Block>: Unpin,
*const (Pat, Option<Comma>) is !null: Unpin,
Box<Pat>: Unpin,
*const ExprElseIf is !null: Unpin,
*const (ExprMatchBranch, Option<Comma>) is !null: Unpin,
*const (Expr, Option<Comma>) is !null: Unpin,
*const Stmt is !null: Unpin,
Box<Local>: Unpin,
*const (ItemUsePath, Option<Comma>) is !null: Unpin,
*const (ColonColon, ItemUseSegment) is !null: Unpin,
*const (FnArg, Option<Comma>) is !null: Unpin,
*const (ItemVariant, Option<Comma>) is !null: Unpin,
*const (Field, Option<Comma>) is !null: Unpin,
*const (ImplItem, Option<SemiColon>) is !null: Unpin,
Box<File>: Unpin,
*const (ExprSelectBranch, Option<Comma>) is !null: Unpin,
*const (FieldAssign, Option<Comma>) is !null: Unpin,
*const (ColonColon, PathSegment) is !null: Unpin,
*const (Box<Type>, Option<Comma>) is !null: Unpin,
Box<Type>: Unpin,
impl UnsafeUnpin for Typewhere
*const (PathSegmentExpr, Option<Comma>) is !null: UnsafeUnpin,
PhantomData<(PathSegmentExpr, Option<Comma>)>: UnsafeUnpin,
*const (ColonColon, PathSegment) is !null: UnsafeUnpin,
PhantomData<(ColonColon, PathSegment)>: UnsafeUnpin,
*const (Box<Type>, Option<Comma>) is !null: UnsafeUnpin,
PhantomData<(Box<Type>, Option<Comma>)>: UnsafeUnpin,
impl UnwindSafe for Typewhere
NonNull<(PathSegmentExpr, Option<Comma>)>: UnwindSafe,
NonNull<Attribute>: UnwindSafe,
NonNull<Token>: UnwindSafe,
NonZero<u32>: UnwindSafe,
NonNull<Expr>: UnwindSafe,
NonNull<Condition>: UnwindSafe,
NonNull<(Pat, Option<Comma>)>: UnwindSafe,
NonNull<Pat>: UnwindSafe,
NonNull<Block>: UnwindSafe,
NonNull<Stmt>: UnwindSafe,
NonNull<Local>: UnwindSafe,
NonNull<(ItemUsePath, Option<Comma>)>: UnwindSafe,
NonNull<(ColonColon, ItemUseSegment)>: UnwindSafe,
NonNull<(FnArg, Option<Comma>)>: UnwindSafe,
NonNull<(ItemVariant, Option<Comma>)>: UnwindSafe,
NonNull<(Field, Option<Comma>)>: UnwindSafe,
NonNull<(ImplItem, Option<SemiColon>)>: UnwindSafe,
NonNull<File>: UnwindSafe,
NonNull<(Item, Option<SemiColon>)>: UnwindSafe,
NonNull<ExprElseIf>: UnwindSafe,
NonNull<(ExprMatchBranch, Option<Comma>)>: UnwindSafe,
NonNull<(Expr, Option<Comma>)>: UnwindSafe,
NonNull<(ExprSelectBranch, Option<Comma>)>: UnwindSafe,
NonNull<(FieldAssign, Option<Comma>)>: UnwindSafe,
NonNull<(ColonColon, PathSegment)>: UnwindSafe,
NonNull<(Box<Type>, Option<Comma>)>: UnwindSafe,
NonNull<Type>: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.