Enum rustdoc::clean::Type[src]

pub enum Type {
    ResolvedPath {
        pub path: Path,
        pub typarams: Option<Vec<TyParamBound>>,
        pub did: DefId,
    },
    TyParamBinder(NodeId),
    Generic(DefId),
    Self(DefId),
    Primitive(Primitive),
    Closure(Box<ClosureDecl>, Option<Lifetime>),
    Proc(Box<ClosureDecl>),
    BareFunction(Box<BareFunctionDecl>),
    Tuple(Vec<Type>),
    Vector(Box<Type>),
    FixedVector(Box<Type>, String),
    Bottom,
    Unique(Box<Type>),
    Managed(Box<Type>),
    RawPointer(Mutability, Box<Type>),
    BorrowedRef {
        pub lifetime: Option<Lifetime>,
        pub mutability: Mutability,
        pub type_: Box<Type>,
    },
}

A representation of a Type suitable for hyperlinking purposes. Ideally one can get the original type out of the AST/ty::ctxt given one of these, if more information is needed. Most importantly it does not preserve mutability or boxes.

Variants

ResolvedPath

structs/enums/traits (anything that'd be an ast::TyPath)

Fields

path
typarams
did
TyParamBinder
Generic

For parameterized types, so the consumer of the JSON don't go looking for types which don't exist anywhere.

Self

For references to self

Primitive

Primitives are just the fixed-size numeric types (plus int/uint/float), and char.

Closure
Proc
BareFunction

extern "ABI" fn

Tuple
Vector
FixedVector
Bottom

aka TyBot

Unique
Managed
RawPointer
BorrowedRef

Fields

lifetime
mutability
type_

Trait Implementations

impl Show for Type

fn fmt(&self, f: &mut Formatter) -> Result

Derived Implementations

impl<__D: Decoder<__E>, __E> Decodable<__D, __E> for Type

fn decode(__arg_0: &mut __D) -> Result<Type, __E>

impl<__S: Encoder<__E>, __E> Encodable<__S, __E> for Type

fn encode(&self, __arg_0: &mut __S) -> Result<(), __E>

impl Clone for Type

fn clone(&self) -> Type

fn clone_from(&mut self, source: &Self)