pub struct PackedBlockPos(i64);Expand description
A block position in Minecraft’s packed protocol i64 layout.
Tuple Fields§
§0: i64Implementations§
Source§impl PackedBlockPos
impl PackedBlockPos
const HORIZONTAL_BITS: u32 = 26
const Y_BITS: u32 = 12
const X_OFFSET: u32
const Z_OFFSET: u32 = Self::Y_BITS
const XZ_MASK: i64
const Y_MASK: i64
Sourcepub const fn from_raw(raw: i64) -> Self
pub const fn from_raw(raw: i64) -> Self
Creates a packed block position from its raw representation.
Sourcepub const fn to_block_pos(self) -> BlockPos
pub const fn to_block_pos(self) -> BlockPos
Converts this packed value into a BlockPos.
Trait Implementations§
Source§impl Clone for PackedBlockPos
impl Clone for PackedBlockPos
Source§fn clone(&self) -> PackedBlockPos
fn clone(&self) -> PackedBlockPos
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 PackedBlockPos
Source§impl Debug for PackedBlockPos
impl Debug for PackedBlockPos
impl Eq for PackedBlockPos
Source§impl From<BlockPos> for PackedBlockPos
impl From<BlockPos> for PackedBlockPos
Source§impl From<PackedBlockPos> for BlockPos
impl From<PackedBlockPos> for BlockPos
Source§fn from(pos: PackedBlockPos) -> Self
fn from(pos: PackedBlockPos) -> Self
Converts to this type from the input type.
Source§impl Hash for PackedBlockPos
impl Hash for PackedBlockPos
Source§impl Ord for PackedBlockPos
impl Ord for PackedBlockPos
Source§fn cmp(&self, other: &PackedBlockPos) -> Ordering
fn cmp(&self, other: &PackedBlockPos) -> 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 PackedBlockPos
impl PartialEq for PackedBlockPos
Source§fn eq(&self, other: &PackedBlockPos) -> bool
fn eq(&self, other: &PackedBlockPos) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for PackedBlockPos
impl PartialOrd for PackedBlockPos
Source§impl ReadFrom for PackedBlockPos
impl ReadFrom for PackedBlockPos
Source§impl<'de, WincodeConfig: Config> SchemaRead<'de, WincodeConfig> for PackedBlockPos
impl<'de, WincodeConfig: Config> SchemaRead<'de, WincodeConfig> for PackedBlockPos
type Dst = PackedBlockPos
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 PackedBlockPos
impl<WincodeConfig: Config> SchemaWrite<WincodeConfig> for PackedBlockPos
impl StructuralPartialEq for PackedBlockPos
Auto Trait Implementations§
impl Freeze for PackedBlockPos
impl RefUnwindSafe for PackedBlockPos
impl Send for PackedBlockPos
impl Sync for PackedBlockPos
impl Unpin for PackedBlockPos
impl UnsafeUnpin for PackedBlockPos
impl UnwindSafe for PackedBlockPos
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.