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

pub enum Type {
    ResolvedPath {
        path: Path,
        typarams: Option<Vec<TyParamBound>>,
        did: DefId,
        is_generic: bool,
    },
    Generic(String),
    Primitive(PrimitiveType),
    BareFunction(Box<BareFunctionDecl>),
    Tuple(Vec<Type>),
    Vector(Box<Type>),
    FixedVector(Box<Type>, String),
    Bottom,
    Unique(Box<Type>),
    RawPointer(MutabilityBox<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 (rustdoc)

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

Variants

ResolvedPath
Unstable (rustdoc)

structs/enums/traits (most that'd be an hir::TyPath)

Fields

path: Path
Unstable (rustdoc)
typarams: Option<Vec<TyParamBound>>
Unstable (rustdoc)
did: DefId
Unstable (rustdoc)
is_generic: bool
Unstable (rustdoc)

true if is a T::Name path for associated types

Generic(String)
Unstable (rustdoc)

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

Primitive(PrimitiveType)
Unstable (rustdoc)

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

BareFunction(Box<BareFunctionDecl>)
Unstable (rustdoc)

extern "ABI" fn

Tuple(Vec<Type>)
Unstable (rustdoc)
Vector(Box<Type>)
Unstable (rustdoc)
FixedVector(Box<Type>, String)
Unstable (rustdoc)
Bottom
Unstable (rustdoc)

aka TyBot

Unique(Box<Type>)
Unstable (rustdoc)
RawPointer(MutabilityBox<Type>)
Unstable (rustdoc)
BorrowedRef
Unstable (rustdoc)

Fields

lifetime: Option<Lifetime>
Unstable (rustdoc)
mutability: Mutability
Unstable (rustdoc)
type_: Box<Type>
Unstable (rustdoc)
QPath
Unstable (rustdoc)

Fields

name: String
Unstable (rustdoc)
self_type: Box<Type>
Unstable (rustdoc)
trait_: Box<Type>
Unstable (rustdoc)
Infer
Unstable (rustdoc)
PolyTraitRef(Vec<TyParamBound>)
Unstable (rustdoc)

Methods

impl Type
[src]

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

fn is_generic(&self) -> bool

Trait Implementations

impl GetDefId for Type
[src]

fn def_id(&self) -> Option<DefId>

impl Display for Type
[src]

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

Formats the value using the given formatter.

Derived Implementations

impl Debug for Type
[src]

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

Formats the value using the given formatter.

impl PartialEq for Type
[src]

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

This method tests for self and other values to be equal, and is used by ==. Read more

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

This method tests for !=.

impl Decodable for Type
[src]

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

impl Encodable for Type
[src]

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

impl Clone for Type
[src]

fn clone(&self) -> Type

Returns a copy of the value. Read more

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

Performs copy-assignment from source. Read more