Enum amplify_syn::TypeClass[][src]

pub enum TypeClass {
Show variants Array, BareFn, Group, ImplTrait, Infer, Macro, Never, Paren, Path, Ptr, Reference, Slice, TraitObject, Tuple, Verbatim,
}

Constrains for the possible types that a Rust value could have.

Variants

Array

A fixed size array type: [T; n].

BareFn

A bare function type: fn(usize) -> bool.

Group

A type contained within invisible delimiters.

ImplTrait

An impl Bound1 + Bound2 + Bound3 type where Bound is a trait or a lifetime.

Infer

Indication that a type should be inferred by the compiler: _.

Macro

A macro in the type position.

Never

The never type: !.

Paren

A parenthesized type equivalent to the inner type.

Path

A path like std::slice::Iter, optionally qualified with a self-type as in <Vec<T> as SomeTrait>::Associated.

Ptr

A raw pointer type: *const T or *mut T.

Reference

A reference type: &'a T or &'a mut T.

Slice

A dynamically sized slice type: [T].

TraitObject

A trait object type Bound1 + Bound2 + Bound3 where Bound is a trait or a lifetime.

Tuple

A tuple type: (A, B, C, String).

Verbatim

Tokens in type position not interpreted by Syn.

Implementations

impl TypeClass[src]

pub fn check(
    self,
    ty: &Type,
    attr: impl ToString,
    arg: impl ToString
) -> Result<(), Error>
[src]

Checks the Type against current requirements, generating Error if the requirements are not met.

Trait Implementations

impl Clone for TypeClass[src]

impl Copy for TypeClass[src]

impl Debug for TypeClass[src]

impl Eq for TypeClass[src]

impl From<&'_ Type> for TypeClass[src]

impl From<Type> for TypeClass[src]

impl Hash for TypeClass[src]

impl Ord for TypeClass[src]

impl PartialEq<TypeClass> for TypeClass[src]

impl PartialOrd<TypeClass> for TypeClass[src]

impl StructuralEq for TypeClass[src]

impl StructuralPartialEq for TypeClass[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.