#[repr(u8)]pub enum OptEncoding {
Required = 0,
ZeroNiche = 1,
Bit0Present = 2,
PlusOne = 3,
TagXor = 4,
WideBit = 5,
}Expand description
Optionality and wire-bit encoding strategy for a FieldDesc.
Included in compute_table_schema_hash so T and Option<T> never collide even when
niche encoding keeps their bit widths equal (e.g. Length, GridLine, 3-variant WordEnum).
Variants§
Required = 0
Non-optional field (required value, Str, or Res<R>).
ZeroNiche = 1
Optional handle using zero as the None niche (Option<NodeId>, Option<SurfaceId>).
Bit0Present = 2
Optional sub-word integer/bitflags with presence bit at bit 0 and payload in bits 1...
PlusOne = 3
Optional bool or WordEnum where 0 = None and discriminant + 1 = Some(v).
TagXor = 4
Optional tagged value (Length, GridLine) XORed with its unused tag niche so 0 = None.
WideBit = 5
Wide optional (Option<f32|u32|i32|Rgba>): 1-bit presence flag in word + full val_word.
Trait Implementations§
Source§impl Clone for OptEncoding
impl Clone for OptEncoding
Source§fn clone(&self) -> OptEncoding
fn clone(&self) -> OptEncoding
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for OptEncoding
Source§impl Debug for OptEncoding
impl Debug for OptEncoding
impl Eq for OptEncoding
Source§impl Hash for OptEncoding
impl Hash for OptEncoding
Source§impl PartialEq for OptEncoding
impl PartialEq for OptEncoding
impl StructuralPartialEq for OptEncoding
Auto Trait Implementations§
impl Forget for OptEncoding
impl Freeze for OptEncoding
impl Move for OptEncoding
impl RefUnwindSafe for OptEncoding
impl Send for OptEncoding
impl Sync for OptEncoding
impl Unpin for OptEncoding
impl UnsafeUnpin for OptEncoding
impl UnwindSafe for OptEncoding
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