pub struct PackedChunkLocalXZ(u8);Expand description
A block’s X/Z position packed relative to its containing chunk.
Layout: (x << 4) | z, with each coordinate using 4 bits.
Tuple Fields§
§0: u8Implementations§
Source§impl PackedChunkLocalXZ
impl PackedChunkLocalXZ
const COORD_MASK: u8 = 0x0f
Sourcepub const fn from_block_pos(pos: BlockPos) -> Self
pub const fn from_block_pos(pos: BlockPos) -> Self
Packs an absolute block position by masking X and Z to chunk-local range.
Sourcepub const fn from_local_xz(x: u8, z: u8) -> Option<Self>
pub const fn from_local_xz(x: u8, z: u8) -> Option<Self>
Packs validated chunk-local X/Z coordinates.
Sourcepub const fn from_raw(raw: u8) -> Self
pub const fn from_raw(raw: u8) -> Self
Rebuilds a packed chunk-local X/Z position from its raw representation.
const fn from_local_unchecked(x: u8, z: u8) -> Self
Trait Implementations§
Source§impl Clone for PackedChunkLocalXZ
impl Clone for PackedChunkLocalXZ
Source§fn clone(&self) -> PackedChunkLocalXZ
fn clone(&self) -> PackedChunkLocalXZ
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 PackedChunkLocalXZ
Source§impl Debug for PackedChunkLocalXZ
impl Debug for PackedChunkLocalXZ
impl Eq for PackedChunkLocalXZ
Source§impl From<BlockPos> for PackedChunkLocalXZ
impl From<BlockPos> for PackedChunkLocalXZ
Source§impl Hash for PackedChunkLocalXZ
impl Hash for PackedChunkLocalXZ
Source§impl Ord for PackedChunkLocalXZ
impl Ord for PackedChunkLocalXZ
Source§fn cmp(&self, other: &PackedChunkLocalXZ) -> Ordering
fn cmp(&self, other: &PackedChunkLocalXZ) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for PackedChunkLocalXZ
impl PartialEq for PackedChunkLocalXZ
Source§fn eq(&self, other: &PackedChunkLocalXZ) -> bool
fn eq(&self, other: &PackedChunkLocalXZ) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for PackedChunkLocalXZ
impl PartialOrd for PackedChunkLocalXZ
Source§impl ReadFrom for PackedChunkLocalXZ
impl ReadFrom for PackedChunkLocalXZ
Source§impl<'de, WincodeConfig: Config> SchemaRead<'de, WincodeConfig> for PackedChunkLocalXZ
impl<'de, WincodeConfig: Config> SchemaRead<'de, WincodeConfig> for PackedChunkLocalXZ
type Dst = PackedChunkLocalXZ
Source§fn read(
reader: impl Reader<'de>,
dst: &mut MaybeUninit<Self::Dst>,
) -> ReadResult<()>
fn read( reader: impl Reader<'de>, dst: &mut MaybeUninit<Self::Dst>, ) -> ReadResult<()>
Source§impl<WincodeConfig: Config> SchemaWrite<WincodeConfig> for PackedChunkLocalXZ
impl<WincodeConfig: Config> SchemaWrite<WincodeConfig> for PackedChunkLocalXZ
impl StructuralPartialEq for PackedChunkLocalXZ
Auto Trait Implementations§
impl Freeze for PackedChunkLocalXZ
impl RefUnwindSafe for PackedChunkLocalXZ
impl Send for PackedChunkLocalXZ
impl Sync for PackedChunkLocalXZ
impl Unpin for PackedChunkLocalXZ
impl UnsafeUnpin for PackedChunkLocalXZ
impl UnwindSafe for PackedChunkLocalXZ
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,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<'de, T, C> Deserialize<'de, C> for Twhere
C: Config,
T: SchemaRead<'de, C>,
impl<'de, T, C> Deserialize<'de, C> for Twhere
C: Config,
T: SchemaRead<'de, C>,
§fn deserialize(src: &'de [u8], config: C) -> Result<Self::Dst, ReadError>
fn deserialize(src: &'de [u8], config: C) -> Result<Self::Dst, ReadError>
Deserialize the input bytes into a new
Self::Dst.§fn deserialize_into(
src: &'de [u8],
dst: &mut MaybeUninit<Self::Dst>,
config: C,
) -> Result<(), ReadError>
fn deserialize_into( src: &'de [u8], dst: &mut MaybeUninit<Self::Dst>, config: C, ) -> Result<(), ReadError>
Deserialize the input bytes into
dst.§impl<'de, T> Deserialize<'de> for Twhere
T: SchemaRead<'de, Configuration>,
impl<'de, T> Deserialize<'de> for Twhere
T: SchemaRead<'de, Configuration>,
§fn deserialize(src: &'de [u8]) -> Result<Self::Dst, ReadError>
fn deserialize(src: &'de [u8]) -> Result<Self::Dst, ReadError>
Deserialize the input
src bytes into a new Self::Dst.§fn deserialize_into(
src: &'de [u8],
dst: &mut MaybeUninit<Self::Dst>,
) -> Result<(), ReadError>
fn deserialize_into( src: &'de [u8], dst: &mut MaybeUninit<Self::Dst>, ) -> Result<(), ReadError>
Deserialize the input
src bytes into dst.§impl<T> DeserializeOwned for Twhere
T: SchemaReadOwned<Configuration>,
impl<T> DeserializeOwned for Twhere
T: SchemaReadOwned<Configuration>,
§fn deserialize_from<'de>(src: impl Reader<'de>) -> Result<Self::Dst, ReadError>
fn deserialize_from<'de>(src: impl Reader<'de>) -> Result<Self::Dst, ReadError>
Deserialize from the given [
Reader] into a new Self::Dst.§fn deserialize_from_into<'de>(
src: impl Reader<'de>,
dst: &mut MaybeUninit<Self::Dst>,
) -> Result<(), ReadError>
fn deserialize_from_into<'de>( src: impl Reader<'de>, dst: &mut MaybeUninit<Self::Dst>, ) -> Result<(), ReadError>
Deserialize from the given [
Reader] into dst.§impl<T, C> DeserializeOwned<C> for Twhere
C: Config,
T: SchemaReadOwned<C>,
impl<T, C> DeserializeOwned<C> for Twhere
C: Config,
T: SchemaReadOwned<C>,
§fn deserialize_from<'de>(src: impl Reader<'de>) -> Result<Self::Dst, ReadError>
fn deserialize_from<'de>(src: impl Reader<'de>) -> Result<Self::Dst, ReadError>
Deserialize from the given [
Reader] into a new Self::Dst.§fn deserialize_from_into<'de>(
src: impl Reader<'de>,
dst: &mut MaybeUninit<Self::Dst>,
) -> Result<(), ReadError>
fn deserialize_from_into<'de>( src: impl Reader<'de>, dst: &mut MaybeUninit<Self::Dst>, ) -> Result<(), ReadError>
Deserialize from the given [
Reader] into dst.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<N> NodeTrait for N
impl<T, C> SchemaReadOwned<C> for Twhere
C: ConfigCore,
T: for<'de> SchemaRead<'de, C>,
§impl<T> Serialize for Twhere
T: SchemaWrite<Configuration> + ?Sized,
impl<T> Serialize for Twhere
T: SchemaWrite<Configuration> + ?Sized,
§fn serialize(src: &Self::Src) -> Result<Vec<u8>, WriteError>
fn serialize(src: &Self::Src) -> Result<Vec<u8>, WriteError>
Serialize a serializable type into a
Vec of bytes.§fn serialize_into(dst: impl Writer, src: &Self::Src) -> Result<(), WriteError>
fn serialize_into(dst: impl Writer, src: &Self::Src) -> Result<(), WriteError>
Serialize a serializable type into the given byte buffer.
§fn serialized_size(src: &Self::Src) -> Result<u64, WriteError>
fn serialized_size(src: &Self::Src) -> Result<u64, WriteError>
Get the size in bytes of the type when serialized.
§impl<T, C> Serialize<C> for Twhere
C: Config,
T: SchemaWrite<C> + ?Sized,
impl<T, C> Serialize<C> for Twhere
C: Config,
T: SchemaWrite<C> + ?Sized,
§fn serialize(src: &Self::Src, config: C) -> Result<Vec<u8>, WriteError>
fn serialize(src: &Self::Src, config: C) -> Result<Vec<u8>, WriteError>
Serialize a serializable type into a
Vec of bytes.§fn serialize_into(
dst: impl Writer,
src: &Self::Src,
config: C,
) -> Result<(), WriteError>
fn serialize_into( dst: impl Writer, src: &Self::Src, config: C, ) -> Result<(), WriteError>
Serialize a serializable type into the given [
Writer].§fn serialized_size(src: &Self::Src, config: C) -> Result<u64, WriteError>
fn serialized_size(src: &Self::Src, config: C) -> Result<u64, WriteError>
Get the size in bytes of the type when serialized.