Enum rustdoc::clean::Type [−] [src]

pub enum Type {
    ResolvedPath {
        path: Path,
        typarams: Option<Vec<TyParamBound>>,
        did: DefId,
    },
    Generic(String),
    Primitive(PrimitiveType),
    BareFunction(Box<BareFunctionDecl>),
    Tuple(Vec<Type>),
    Vector(Box<Type>),
    FixedVector(Box<Type>, String),
    Bottom,
    Unique(Box<Type>),
    RawPointer(Mutability, Box<Type>),
    BorrowedRef {
        lifetime: Option<Lifetime>,
        mutability: Mutability,
        type_: Box<Type>,
    },
    QPath {
        name: String,
        self_type: Box<Type>,
        trait_: Box<Type>,
    },
    Infer,
    PolyTraitRef(Vec<TyParamBound>),
}
Unstable

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
Unstable

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

Fields

path
Unstable
typarams
Unstable
did
Unstable
Generic
Unstable

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

Primitive
Unstable

Primitives are the fixed-size numeric types (plus int/usize/float), char, arrays, slices, and tuples.

BareFunction
Unstable

extern "ABI" fn

Tuple
Unstable
Vector
Unstable
FixedVector
Unstable
Bottom
Unstable

aka TyBot

Unique
Unstable
RawPointer
Unstable
BorrowedRef
Unstable

Fields

lifetime
Unstable
mutability
Unstable
type_
Unstable
QPath
Unstable

Fields

name
Unstable
self_type
Unstable
trait_
Unstable
Infer
Unstable
PolyTraitRef
Unstable

Methods

impl Type

fn primitive_type(&self) -> Option<PrimitiveType>

Unstable

Trait Implementations

impl Display for Type

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

Derived Implementations

impl Debug for Type

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

impl PartialEq for Type

fn eq(&self, __arg_0: &Type) -> bool

fn ne(&self, __arg_0: &Type) -> bool

impl Decodable for Type

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

impl Encodable for Type

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

impl Clone for Type

fn clone(&self) -> Type

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