pub struct LightArray(pub [u8; 2048]);Expand description
Packed light levels for one 16x16x16 chunk section.
The wire representation is a VarInt length of exactly 2048 followed by
2048 bytes. Each byte stores two light levels, with the lower-indexed value
in the low nibble. Every light level is therefore in the range 0..=15.
Tuple Fields§
§0: [u8; 2048]The 2048 packed light bytes.
Implementations§
Source§impl LightArray
impl LightArray
Sourcepub fn light_level(&self, index: usize) -> Option<u8>
pub fn light_level(&self, index: usize) -> Option<u8>
Returns the light level at a packed value index from 0 through 4095.
Sourcepub const fn as_bytes(&self) -> &[u8; 2048]
pub const fn as_bytes(&self) -> &[u8; 2048]
Returns the packed 2048-byte payload without its length prefix.
Sourcepub fn into_bytes(self) -> [u8; 2048]
pub fn into_bytes(self) -> [u8; 2048]
Extracts the packed 2048-byte payload.
Trait Implementations§
Source§impl Clone for LightArray
impl Clone for LightArray
Source§fn clone(&self) -> LightArray
fn clone(&self) -> LightArray
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 moreSource§impl Debug for LightArray
impl Debug for LightArray
Source§impl Default for LightArray
impl Default for LightArray
impl Eq for LightArray
Source§impl Hash for LightArray
impl Hash for LightArray
Source§impl PartialEq for LightArray
impl PartialEq for LightArray
impl StructuralPartialEq for LightArray
Auto Trait Implementations§
impl Freeze for LightArray
impl RefUnwindSafe for LightArray
impl Send for LightArray
impl Sync for LightArray
impl Unpin for LightArray
impl UnsafeUnpin for LightArray
impl UnwindSafe for LightArray
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.