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>), Slice(Box<Type>), Array(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>), }
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
structs/enums/traits (most that'd be an hir::TyPath)
Fields of ResolvedPath
path: Path | |
typarams: Option<Vec<TyParamBound>> | |
did: DefId | |
is_generic: bool | true if is a |
Generic(String)
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
Tuple(Vec<Type>)
Slice(Box<Type>)
Array(Box<Type>, String)
Never
Unique(Box<Type>)
RawPointer(Mutability, Box<Type>)
BorrowedRef
Fields of BorrowedRef
lifetime: Option<Lifetime> | |
mutability: Mutability | |
type_: Box<Type> |
QPath
Fields of QPath
name: String | |
self_type: Box<Type> | |
trait_: Box<Type> |
Infer
ImplTrait(Vec<TyParamBound>)
Methods
impl Type
[src]
impl Type
pub fn primitive_type(&self) -> Option<PrimitiveType>
[src]
pub fn primitive_type(&self) -> Option<PrimitiveType>
pub fn is_generic(&self) -> bool
[src]
pub fn is_generic(&self) -> bool
pub fn is_self_type(&self) -> bool
[src]
pub fn is_self_type(&self) -> bool
pub fn generics(&self) -> Option<&[Type]>
[src]
pub fn generics(&self) -> Option<&[Type]>
Trait Implementations
impl<'tcx> Clean<Type> for ProjectionTy<'tcx>
[src]
impl<'tcx> Clean<Type> for ProjectionTy<'tcx>
fn clean(&self, cx: &DocContext) -> Type
[src]
fn clean(&self, cx: &DocContext) -> Type
impl Clean<Type> for TraitRef
[src]
impl Clean<Type> for TraitRef
fn clean(&self, cx: &DocContext) -> Type
[src]
fn clean(&self, cx: &DocContext) -> Type
impl Clone for Type
[src]
impl Clone for Type
fn clone(&self) -> Type
[src]
fn clone(&self) -> Type
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Encodable for Type
[src]
impl Encodable for Type
fn encode<__S: Encoder>(&self, s: &mut __S) -> Result<(), __S::Error>
[src]
fn encode<__S: Encoder>(&self, s: &mut __S) -> Result<(), __S::Error>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
impl Decodable for Type
[src]
impl Decodable for Type
fn decode<__D: Decoder>(d: &mut __D) -> Result<Type, __D::Error>
[src]
fn decode<__D: Decoder>(d: &mut __D) -> Result<Type, __D::Error>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
impl PartialEq for Type
[src]
impl PartialEq for Type
fn eq(&self, other: &Type) -> bool
[src]
fn eq(&self, other: &Type) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Type) -> bool
[src]
fn ne(&self, other: &Type) -> bool
This method tests for !=
.
impl Eq for Type
[src]
impl Eq for Type
fn assert_receiver_is_total_eq(&self)
[src]
fn assert_receiver_is_total_eq(&self)
impl Debug for Type
[src]
impl Debug for Type
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Hash for Type
[src]
impl Hash for Type
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl GetDefId for Type
[src]
impl GetDefId for Type
impl Clean<Type> for Ty
[src]
impl Clean<Type> for Ty
fn clean(&self, cx: &DocContext) -> Type
[src]
fn clean(&self, cx: &DocContext) -> Type
impl<'tcx> Clean<Type> for Ty<'tcx>
[src]
impl<'tcx> Clean<Type> for Ty<'tcx>
fn clean(&self, cx: &DocContext) -> Type
[src]
fn clean(&self, cx: &DocContext) -> Type
impl Display for Type
[src]
impl Display for Type