#[repr(C)]pub struct EnumVariantShape {
pub name: &'static str,
pub payload: &'static [*const TypeDescriptor],
}Expand description
One variant of an enum shape: its source name plus the descriptors for its payload slots, in declaration order. A payload-less variant has an empty slice.
A slot may be null, meaning the producer had no static type for it —
exactly the encoding TupleSchema uses. The
runtime’s own Option schema is the motivating case: praxis_map_get
learns V from the value it found, never from a static type, so Some’s
slot is unknown there and known (Int, Text, …) in the schema the codegen
builds for the same Option. The two must still be one type, and the
value’s descriptor — read off its header, so never wrong — answers for an
unknown slot.
Fields§
§name: &'static str§payload: &'static [*const TypeDescriptor]Auto Trait Implementations§
impl !Send for EnumVariantShape
impl !Sync for EnumVariantShape
impl Freeze for EnumVariantShape
impl RefUnwindSafe for EnumVariantShape
impl Unpin for EnumVariantShape
impl UnsafeUnpin for EnumVariantShape
impl UnwindSafe for EnumVariantShape
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more