Enum rustdoc::clean::types::Type [−][src]
pub(crate) enum Type {
Show 14 variants
ResolvedPath {
path: Path,
did: DefId,
is_generic: bool,
},
DynTrait(Vec<PolyTrait>, Option<Lifetime>),
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).
Fields of ResolvedPath
dyn for<'a> Trait<'a> + Send + 'static
For parameterized types, so the consumer of the JSON don’t go looking for types which don’t exist anywhere.
Tuple Fields of Generic
0: SymbolPrimitives are the fixed-size numeric types (plus int/usize/float), char, arrays, slices, and tuples.
Tuple Fields of Primitive
extern "ABI" fn
Tuple Fields of BareFunction
0: Box<BareFunctionDecl>The String field is about the size or the constant representing the array’s length.
Tuple Fields of RawPointer
0: Mutability1: Box<Type>Fields of BorrowedRef
Tuple Fields of ImplTrait
0: 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 Type
impl UnwindSafe for Type
Blanket 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) -> V
Layout
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: 72 bytes