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), Never, 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, ImplTrait(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 of ResolvedPath
path: Path | 🔬 This is a nightly-only experimental API. ( rustdoc ) |
typarams: Option<Vec<TyParamBound>> | 🔬 This is a nightly-only experimental API. ( rustdoc ) |
did: DefId | 🔬 This is a nightly-only experimental API. ( rustdoc ) |
is_generic: bool | 🔬 This is a nightly-only experimental API. ( 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
)Never
rustdoc
)Unique(Box<Type>)
rustdoc
)RawPointer(Mutability, Box<Type>)
rustdoc
)BorrowedRef
rustdoc
)Fields of BorrowedRef
lifetime: Option<Lifetime> | 🔬 This is a nightly-only experimental API. ( rustdoc ) |
mutability: Mutability | 🔬 This is a nightly-only experimental API. ( rustdoc ) |
type_: Box<Type> | 🔬 This is a nightly-only experimental API. ( rustdoc ) |
QPath
rustdoc
)Fields of QPath
name: String | 🔬 This is a nightly-only experimental API. ( rustdoc ) |
self_type: Box<Type> | 🔬 This is a nightly-only experimental API. ( rustdoc ) |
trait_: Box<Type> | 🔬 This is a nightly-only experimental API. ( rustdoc ) |
Infer
rustdoc
)ImplTrait(Vec<TyParamBound>)
rustdoc
)Methods
impl Type
[src]
fn primitive_type(&self) -> Option<PrimitiveType>
rustdoc
)fn is_generic(&self) -> bool
rustdoc
)fn is_self_type(&self) -> bool
rustdoc
)Trait Implementations
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
impl Encodable for Type
[src]
fn encode<__S: Encoder>(&self, __arg_0: &mut __S) -> Result<(), __S::Error>
🔬 This is a nightly-only experimental API. (rustc_private
)
deprecated in favor of rustc-serialize on crates.io
impl Decodable for Type
[src]
fn decode<__D: Decoder>(__arg_0: &mut __D) -> Result<Type, __D::Error>
🔬 This is a nightly-only experimental API. (rustc_private
)
deprecated in favor of rustc-serialize on crates.io
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 !=
.