Enum syn::Ty
[−]
[src]
pub enum Ty {
Slice(Box<Ty>),
Array(Box<Ty>, ConstExpr),
Ptr(Box<MutTy>),
Rptr(Option<Lifetime>, Box<MutTy>),
BareFn(Box<BareFnTy>),
Never,
Tup(Vec<Ty>),
Path(Option<QSelf>, Path),
TraitObject(Vec<TyParamBound>),
ImplTrait(Vec<TyParamBound>),
Paren(Box<Ty>),
Infer,
Mac(Mac),
}The different kinds of types recognized by the compiler
Variants
Slice(Box<Ty>)A variable-length array ([T])
Array(Box<Ty>, ConstExpr)A fixed length array ([T; n])
Ptr(Box<MutTy>)A raw pointer (*const T or *mut T)
Rptr(Option<Lifetime>, Box<MutTy>)A reference (&'a T or &'a mut T)
BareFn(Box<BareFnTy>)A bare function (e.g. fn(usize) -> bool)
NeverThe never type (!)
Tup(Vec<Ty>)A tuple ((A, B, C, D, ...))
Path(Option<QSelf>, Path)A path (module::module::...::Type), optionally
"qualified", e.g. <Vec<T> as SomeTrait>::SomeType.
Type parameters are stored in the Path itself
TraitObject(Vec<TyParamBound>)A trait object type Bound1 + Bound2 + Bound3
where Bound is a trait or a lifetime.
ImplTrait(Vec<TyParamBound>)An impl Bound1 + Bound2 + Bound3 type
where Bound is a trait or a lifetime.
Paren(Box<Ty>)No-op; kept solely so that we can pretty-print faithfully
InferTyKind::Infer means the type should be inferred instead of it having been specified. This can appear anywhere in a type.
Mac(Mac)A macro in the type position.
Trait Implementations
impl ToTokens for Ty[src]
impl Debug for Ty[src]
impl Clone for Ty[src]
fn clone(&self) -> Ty
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0
Performs copy-assignment from source. Read more
impl Eq for Ty[src]
impl PartialEq for Ty[src]
fn eq(&self, __arg_0: &Ty) -> bool
This method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, __arg_0: &Ty) -> bool
This method tests for !=.
impl Hash for Ty[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
Feeds this value into the state given, updating the hasher as necessary.
fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher1.3.0
Feeds a slice of this type into the state provided.