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(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>), }
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
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 |
Generic(String)
rustdoc
)For parameterized types, so the consumer of the JSON don't go looking for types which don't exist anywhere.
Primitive(PrimitiveType)
rustdoc
)Primitives are the fixed-size numeric types (plus int/usize/float), char, arrays, slices, and tuples.
BareFunction(Box<BareFunctionDecl>)
rustdoc
)extern "ABI" fn
Tuple(Vec<Type>)
rustdoc
)Vector(Box<Type>)
rustdoc
)FixedVector(Box<Type>, String)
rustdoc
)Bottom
rustdoc
)aka TyBot
Unique(Box<Type>)
rustdoc
)RawPointer(Mutability, Box<Type>)
rustdoc
)BorrowedRef
rustdoc
)Fields
lifetime: Option<Lifetime> | Unstable ( rustdoc ) |
mutability: Mutability | Unstable ( rustdoc ) |
type_: Box<Type> | Unstable ( rustdoc ) |
QPath
rustdoc
)Fields
name: String | Unstable ( rustdoc ) |
self_type: Box<Type> | Unstable ( rustdoc ) |
trait_: Box<Type> | Unstable ( rustdoc ) |
Infer
rustdoc
)PolyTraitRef(Vec<TyParamBound>)
rustdoc
)Methods
impl Type
[src]
fn primitive_type(&self) -> Option<PrimitiveType>
fn is_generic(&self) -> bool
Trait Implementations
impl GetDefId for Type
[src]
impl Display for Type
[src]
Derived Implementations
impl Debug for Type
[src]
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]
impl Encodable for Type
[src]
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