Enum static_reflect::types::TypeInfo [−][src]
pub enum TypeInfo<'a> {}Show 13 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>>, },
Expand description
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
A floating point number
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
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
A very simple optional, represented as an AsmOption
This never uses the null pointer optimization
Tuple Fields of Optional
0: &'a TypeInfo<'a>
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.
A structure
Tuple Fields of Structure
0: &'a StructureDef<'a>
An untagged union
Tuple Fields of Union
0: &'a UnionDef<'a>
A named, transparent, extern type
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
Fields of Magic
Implementations
Trait Implementations
Whether this type needs to be traced by the garbage collector. Read more
If this type needs a destructor run. Read more
Visit each field in this type Read more
unsafe fn visit_inside_gc<'actual_gc, Visitor, ActualId>(
gc: &mut Gc<'actual_gc, Self, ActualId>,
visitor: &mut Visitor
) -> Result<(), Visitor::Err> where
Visitor: GcVisitor,
ActualId: CollectorId,
Self: GcSafe + 'actual_gc,
unsafe fn visit_inside_gc<'actual_gc, Visitor, ActualId>(
gc: &mut Gc<'actual_gc, Self, ActualId>,
visitor: &mut Visitor
) -> Result<(), Visitor::Err> where
Visitor: GcVisitor,
ActualId: CollectorId,
Self: GcSafe + 'actual_gc,
Visit this object, assuming its already inside a GC pointer. Read more
Auto Trait Implementations
impl<'a> RefUnwindSafe for TypeInfo<'a>
impl<'a> UnwindSafe for TypeInfo<'a>
Blanket Implementations
Mutably borrows from an owned value. Read more