# 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`)

`Never`

The 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

`Infer`

TyKind::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]

#### `fn to_tokens(&self, tokens: &mut Tokens)`
[src]

Write `self` to the given `Tokens`. Read more

### `impl Debug for Ty`
[src]

#### `fn fmt(&self, __arg_0: &mut Formatter) -> Result`
[src]

Formats the value using the given formatter. Read more

### `impl Clone for Ty`
[src]

#### `fn clone(&self) -> Ty`
[src]

Returns a copy of the value. Read more

#### `fn clone_from(&mut self, source: &Self)`
1.0.0
[src]

Performs copy-assignment from `source`. Read more

### `impl Eq for Ty`
[src]

### `impl PartialEq for Ty`
[src]

#### `fn eq(&self, __arg_0: &Ty) -> bool`
[src]

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

#### `fn ne(&self, __arg_0: &Ty) -> bool`
[src]

This method tests for `!=`.

### `impl Hash for Ty`
[src]

#### `fn hash<__H: Hasher>(&self, __arg_0: &mut __H)`
[src]

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

#### `fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,`
1.3.0
[src]

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

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)