Enum rustdoc::clean::types::ConstantKind[−][src]

pub(crate) enum ConstantKind {
    TyConst {
        expr: String,
    },
    Anonymous {
        body: BodyId,
    },
    Extern {
        def_id: DefId,
    },
    Local {
        def_id: DefId,
        body: BodyId,
    },
}

Variants

TyConst

This is the wrapper around ty::Const for a non-local constant. Because it doesn’t have a BodyId, we need to handle it on its own.

Note that ty::Const includes generic parameters, and may not always be uniquely identified by a DefId. So this field must be different from Extern.

Fields of TyConst

expr: String
Anonymous

A constant (expression) that’s not an item or associated item. These are usually found nested inside types (e.g., array lengths) or expressions (e.g., repeat counts), and also used to define explicit discriminant values for enum variants.

Fields of Anonymous

body: BodyId
Extern

A constant from a different crate.

Fields of Extern

def_id: DefId
Local

const FOO: u32 = ...;

Fields of Local

def_id: DefIdbody: BodyId

Trait Implementations

impl Clone for ConstantKind[src]

impl Debug for ConstantKind[src]

impl Eq for ConstantKind[src]

impl Hash for ConstantKind[src]

impl PartialEq<ConstantKind> for ConstantKind[src]

impl StructuralEq for ConstantKind[src]

impl StructuralPartialEq for ConstantKind[src]

Auto Trait Implementations

impl RefUnwindSafe for ConstantKind

impl Send for ConstantKind

impl Sync for ConstantKind

impl Unpin for ConstantKind

impl UnwindSafe for ConstantKind

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<'a, T> Captures<'a> for T where
    T: ?Sized, 
[src]

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

impl<T> Instrument 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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WithConstness for T[src]