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

[]

A variable-length array ([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)

[]

The never type (!)

[]

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.

[]

No-op; kept solely so that we can pretty-print faithfully

[]

TyKind::Infer means the type should be inferred instead of it having been specified. This can appear anywhere in a type.

[]

A macro in the type position.

Trait Implementations

impl ToTokens for Ty
[src]

[src]
[]

Write self to the given Tokens. Read more

impl Debug for Ty
[src]

[src]
[]

Formats the value using the given formatter. Read more

impl Clone for Ty
[src]

[src]
[]

Returns a copy of the value. Read more

1.0.0
[src]
[]

Performs copy-assignment from source. Read more

impl Eq for Ty
[src]

impl PartialEq for Ty
[src]

[src]
[]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]
[]

This method tests for !=.

impl Hash for Ty
[src]

[src]
[]

Feeds this value into the given [Hasher]. Read more

1.3.0
[src]
[]

Feeds a slice of this type into the given [Hasher]. Read more