Enum rustdoc::clean::types::PrimitiveType [−][src]
pub(crate) enum PrimitiveType {
Show 25 variants
Isize,
I8,
I16,
I32,
I64,
I128,
Usize,
U8,
U16,
U32,
U64,
U128,
F32,
F64,
Char,
Bool,
Str,
Slice,
Array,
Tuple,
Unit,
RawPointer,
Reference,
Fn,
Never,
}
Expand description
A primitive (aka, builtin) type.
This represents things like i32
, str
, etc.
N.B. This has to be different from hir::PrimTy
because it also includes types that aren’t
paths, like Self::Unit
.
Variants
Implementations
pub(crate) fn all_impls(
tcx: TyCtxt<'_>
) -> &'static FxHashMap<PrimitiveType, ArrayVec<DefId, 4>>
Returns the DefId of the module with doc(primitive)
for this primitive type.
Panics if there is no such module.
This gives precedence to primitives defined in the current crate, and deprioritizes primitives defined in core
,
but otherwise, if multiple crates define the same primitive, there is no guarantee of which will be picked.
In particular, if a crate depends on both std
and another crate that also defines doc(primitive)
, then
it’s entirely random whether std
or the other crate is picked. (no_std crates are usually fine unless multiple dependencies define a primitive.)
Trait Implementations
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Auto Trait Implementations
impl RefUnwindSafe for PrimitiveType
impl Send for PrimitiveType
impl Sync for PrimitiveType
impl Unpin for PrimitiveType
impl UnwindSafe for PrimitiveType
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
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Layout
Note: Most layout information is completely unstable and may even differ between compilations. 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: 1 byte
Size for each variant:
Isize
: 0 bytesI8
: 0 bytesI16
: 0 bytesI32
: 0 bytesI64
: 0 bytesI128
: 0 bytesUsize
: 0 bytesU8
: 0 bytesU16
: 0 bytesU32
: 0 bytesU64
: 0 bytesU128
: 0 bytesF32
: 0 bytesF64
: 0 bytesChar
: 0 bytesBool
: 0 bytesStr
: 0 bytesSlice
: 0 bytesArray
: 0 bytesTuple
: 0 bytesUnit
: 0 bytesRawPointer
: 0 bytesReference
: 0 bytesFn
: 0 bytesNever
: 0 bytes