Enum rustdoc::clean::types::Type [−][src]
pub(crate) enum Type {
Show variants
ResolvedPath {
path: Path,
param_names: Option<Vec<GenericBound>>,
did: DefId,
is_generic: bool,
},
Generic(Symbol),
Primitive(PrimitiveType),
BareFunction(Box<BareFunctionDecl>),
Tuple(Vec<Type>),
Slice(Box<Type>),
Array(Box<Type>, String),
Never,
RawPointer(Mutability, Box<Type>),
BorrowedRef {
lifetime: Option<Lifetime>,
mutability: Mutability,
type_: Box<Type>,
},
QPath {
name: Symbol,
self_type: Box<Type>,
self_def_id: Option<DefId>,
trait_: Box<Type>,
},
Infer,
ImplTrait(Vec<GenericBound>),
}Expand description
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
Structs/enums/traits (most that would be an hir::TyKind::Path).
Show fields
Generic(Symbol)For parameterized types, so the consumer of the JSON don’t go looking for types which don’t exist anywhere.
Primitive(PrimitiveType)Primitives are the fixed-size numeric types (plus int/usize/float), char, arrays, slices, and tuples.
BareFunction(Box<BareFunctionDecl>)extern "ABI" fn
The String field is about the size or the constant representing the array’s length.
RawPointer(Mutability, Box<Type>)Show fields
Fields of BorrowedRef
Show fields
ImplTrait(Vec<GenericBound>)Implementations
Trait Implementations
Use this method to get the DefId of a clean AST node.
This will return None when called on a primitive clean::Type.
Use Self::def_id_full if you want to include primitives. Read more
Use this method to get the DefId of a clean AST node, including PrimitiveTypes. Read more
Auto Trait Implementations
impl RefUnwindSafe for Typeimpl UnwindSafe for TypeBlanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more
pub fn vzip(self) -> VLayout
Note: Most layout information is completely unstable and may be different between compiler versions and platforms. The only exception is types with certain repr(...) attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.
Size: 96 bytes