pub enum OptionalBlockState {
Absent,
Present(NonAirBlockStateId),
}Expand description
A block state encoded with zero reserved for absence.
Unlike a prefixed optional, this value has no Boolean marker. A zero VarInt is absent; every positive VarInt is a non-air block-state registry ID.
Variants§
Absent
No block state. Encoded as VarInt(0).
Present(NonAirBlockStateId)
A non-air block state, encoded as its unmodified positive registry ID.
Trait Implementations§
Source§impl Clone for OptionalBlockState
impl Clone for OptionalBlockState
Source§fn clone(&self) -> OptionalBlockState
fn clone(&self) -> OptionalBlockState
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 OptionalBlockState
Source§impl Debug for OptionalBlockState
impl Debug for OptionalBlockState
Source§impl Default for OptionalBlockState
impl Default for OptionalBlockState
Source§fn default() -> OptionalBlockState
fn default() -> OptionalBlockState
Returns the “default value” for a type. Read more
impl Eq for OptionalBlockState
Source§impl Hash for OptionalBlockState
impl Hash for OptionalBlockState
Source§impl PartialEq for OptionalBlockState
impl PartialEq for OptionalBlockState
impl StructuralPartialEq for OptionalBlockState
Auto Trait Implementations§
impl Freeze for OptionalBlockState
impl RefUnwindSafe for OptionalBlockState
impl Send for OptionalBlockState
impl Sync for OptionalBlockState
impl Unpin for OptionalBlockState
impl UnsafeUnpin for OptionalBlockState
impl UnwindSafe for OptionalBlockState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> ContextualCodec for Twhere
T: TypeCodec,
impl<T> ContextualCodec for Twhere
T: TypeCodec,
Source§fn encode_with_context(
&self,
writer: &mut impl Write,
_context: &Context,
) -> Result<(), CodecError>
fn encode_with_context( &self, writer: &mut impl Write, _context: &Context, ) -> Result<(), CodecError>
Encodes this value using context supplied by its enclosing structure.
Source§fn decode_with_context(
reader: &mut impl Read,
_context: &Context,
) -> Result<T, CodecError>where
T: Sized,
fn decode_with_context(
reader: &mut impl Read,
_context: &Context,
) -> Result<T, CodecError>where
T: Sized,
Decodes this value using context supplied by its enclosing structure.