Enum rustc_middle::ty::ClosureKind[][src]

pub enum ClosureKind {
    Fn,
    FnMut,
    FnOnce,
}

Represents the various closure traits in the language. This will determine the type of the environment (self, in the desugaring) argument that the closure expects.

You can get the environment type of a closure using tcx.closure_env_ty().

Variants

Fn
FnMut
FnOnce

Implementations

impl<'tcx> ClosureKind[src]

pub const LATTICE_BOTTOM: ClosureKind[src]

pub fn extends(self, other: ClosureKind) -> bool[src]

Returns true if a type that impls this closure kind must also implement other.

pub fn to_ty(self, tcx: TyCtxt<'tcx>) -> Ty<'tcx>[src]

Returns the representative scalar type for this closure kind. See TyS::to_opt_closure_kind for more details.

Trait Implementations

impl Clone for ClosureKind[src]

impl Copy for ClosureKind[src]

impl Debug for ClosureKind[src]

impl<'tcx, __D: TyDecoder<'tcx>> Decodable<__D> for ClosureKind[src]

impl Display for ClosureKind[src]

impl<'tcx, __E: TyEncoder<'tcx>> Encodable<__E> for ClosureKind[src]

impl Eq for ClosureKind[src]

impl Hash for ClosureKind[src]

impl<'__ctx> HashStable<StableHashingContext<'__ctx>> for ClosureKind[src]

impl<'tcx> Lift<'tcx> for ClosureKind[src]

type Lifted = Self

impl Ord for ClosureKind[src]

impl PartialEq<ClosureKind> for ClosureKind[src]

impl PartialOrd<ClosureKind> for ClosureKind[src]

impl<'tcx, P: PrettyPrinter<'tcx>> Print<'tcx, P> for ClosureKind[src]

type Output = P

type Error = Error

impl StructuralEq for ClosureKind[src]

impl StructuralPartialEq for ClosureKind[src]

impl<'tcx> TypeFoldable<'tcx> for ClosureKind[src]

Auto Trait Implementations

impl RefUnwindSafe for ClosureKind

impl Send for ClosureKind

impl Sync for ClosureKind

impl Unpin for ClosureKind

impl UnwindSafe for ClosureKind

Blanket Implementations

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

impl<'tcx, T> ArenaAllocatable<'tcx, ()> for T where
    T: Copy
[src]

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

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

impl<'a, T> Captures<'a> 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> MaybeResult<T> for T[src]

type Error = !

impl<'tcx, T> Subst<'tcx> for T where
    T: TypeFoldable<'tcx>, 
[src]

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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.

impl<T> WithConstness for T[src]