pub enum TyKind {
Slice(P<Ty>),
Array(P<Ty>, AnonConst),
Ptr(MutTy),
Rptr(Option<Lifetime>, MutTy),
BareFn(P<BareFnTy>),
Never,
Tup(Vec<P<Ty>>),
Path(Option<QSelf>, Path),
TraitObject(GenericBounds, TraitObjectSyntax),
ImplTrait(NodeId, GenericBounds),
Paren(P<Ty>),
Typeof(AnonConst),
Infer,
ImplicitSelf,
Mac(Mac),
Err,
}
The different kinds of types recognized by the compiler.
A variable-length slice ([T]
).
A fixed length array ([T; n]
).
A raw pointer (*const T
or *mut T
).
A reference (&'a T
or &'a mut T
).
A bare function (e.g., fn(usize) -> bool
).
A tuple ((A, B, C, D,...)
).
A path (module::module::...::Type
), optionally
"qualified", e.g., <Vec<T> as SomeTrait>::SomeType
.
Type parameters are stored in the Path
itself.
A trait object type Bound1 + Bound2 + Bound3
where Bound
is a trait or a lifetime.
An impl Bound1 + Bound2 + Bound3
type
where Bound
is a trait or a lifetime.
The NodeId
exists to prevent lowering from having to
generate NodeId
s on the fly, which would complicate
the generation of existential type
items significantly.
No-op; kept solely so that we can pretty-print faithfully.
This means the type should be inferred instead of it having been
specified. This can appear anywhere in a type.
Inferred type of a self
or &self
argument in a method.
A macro in the type position.
Placeholder for a kind that has failed to be defined.
Performs copy-assignment from source
. Read more
Formats the value using the given formatter. Read more
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Create an error for a missing method specialization. Defaults to panicking with type, trait & method names. S
is the encoder/decoder state type, T
is the type being encoded/decoded, and the arguments are the names of the trait and method that should've been overridden. Read more