Enum rustdoc::clean::Type [−][src]
pub enum Type {
ResolvedPath {
path: Path,
typarams: Option<Vec<GenericBound>>,
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<GenericBound>),
}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
ResolvedPathstructs/enums/traits (most that'd be an hir::TyKind::Path)
Fields of ResolvedPath
path: Path | |
typarams: Option<Vec<GenericBound>> | |
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)NeverUnique(Box<Type>)RawPointer(Mutability, Box<Type>)BorrowedRefFields of BorrowedRef
lifetime: Option<Lifetime> | |
mutability: Mutability | |
type_: Box<Type> |
QPathFields of QPath
name: String | |
self_type: Box<Type> | |
trait_: Box<Type> |
InferImplTrait(Vec<GenericBound>)Methods
impl Type[src]
impl Typepub 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) -> boolpub fn is_self_type(&self) -> bool[src]
pub fn is_self_type(&self) -> boolpub 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) -> Typeimpl Clean<Type> for TraitRef[src]
impl Clean<Type> for TraitReffn clean(&self, cx: &DocContext) -> Type[src]
fn clean(&self, cx: &DocContext) -> Typeimpl Clone for Type[src]
impl Clone for Typefn clone(&self) -> Type[src]
fn clone(&self) -> TypeReturns 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 Typefn 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 Typefn 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 Typefn eq(&self, other: &Type) -> bool[src]
fn eq(&self, other: &Type) -> boolThis 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) -> boolThis method tests for !=.
impl Eq for Type[src]
impl Eq for Typefn assert_receiver_is_total_eq(&self)[src]
fn assert_receiver_is_total_eq(&self)impl Debug for Type[src]
impl Debug for Typefn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl Hash for Type[src]
impl Hash for Typefn 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 Typeimpl Clean<Type> for Ty[src]
impl Clean<Type> for Tyfn clean(&self, cx: &DocContext) -> Type[src]
fn clean(&self, cx: &DocContext) -> Typeimpl<'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) -> Typeimpl Display for Type[src]
impl Display for Type