Enum static_reflect::types::TypeInfo [−][src]
pub enum TypeInfo<'a> {}Show variants
Unit, Never, Bool, Integer { size: IntSize, signed: bool, }, Float { size: FloatSize, }, Slice { element_type: &'a TypeInfo<'a>, }, Str, Optional(&'a TypeInfo<'a>), Pointer, Structure(&'a StructureDef<'a>), Union(&'a UnionDef<'a>), Extern { name: &'static str, }, Magic { id: &'static &'static str, extra: Option<&'a TypeInfo<'a>>, },
A type whose representation is known via reflection
These are usually defined statically via [StaticReflect
However, they can be allocated at runtime, and potentially live for a more limited lifetime.
Variants
The zero-length unit type ()
Used for functions that return nothing
An impossible type,
The mere existence of this type at runtime is undefined behavior.
Functions that have this as their return
type never actually return.
A boolean
Like a Rust bool
, values must be either zero or one.
Anything else is undefined behavior.
An integer
Show fields
A floating point number
Show fields
Fields of Float
size: FloatSize
The size/precision of the float
A slice of memory, represented as pointer + length
The element type is needed, since array indexing implicitly multiples by the size of the memory.
Representation should match the AsmSlice type
Show fields
Fields of Slice
element_type: &'a TypeInfo<'a>
The type of the inner element
A pointer to a UTF8 encoded string and length, just like Rust’s ‘str’ type
Internally represented by the AsmStr structure
Optional(&'a TypeInfo<'a>)
A very simple optional, represented as an AsmOption
This never uses the null pointer optimization
An untyped pointer
This may be null.
Untyped pointers simplify the type system significantly. They also avoid cycles when defining structures in case a structure contains a pointer to itself.
Structure(&'a StructureDef<'a>)
A structure
Union(&'a UnionDef<'a>)
An untagged union
A named, transparent, extern type
Show fields
Fields of Extern
name: &'static str
The name of the type
Since this is all we have, it’s what used to disambiguate between them.
A ‘magic’ type, with a user-defined meaning
This allows extensions to the type system
Show fields
Implementations
Trait Implementations
impl<'a> StructuralEq for TypeInfo<'a>
[src]
impl<'a> StructuralEq for TypeInfo<'a>
[src]impl<'a> StructuralPartialEq for TypeInfo<'a>
[src]
impl<'a> StructuralPartialEq for TypeInfo<'a>
[src]Auto Trait Implementations
impl<'a> RefUnwindSafe for TypeInfo<'a>
impl<'a> RefUnwindSafe for TypeInfo<'a>
impl<'a> UnwindSafe for TypeInfo<'a>
impl<'a> UnwindSafe for TypeInfo<'a>