pub struct Chunk(/* private fields */);Expand description
Uncompressed chunk-data.
Implementations§
Source§impl Chunk
impl Chunk
Sourcepub const HYPERVOLUME: usize = 65_536usize
pub const HYPERVOLUME: usize = 65_536usize
The hypervolume of a chunk.
Sourcepub const fn filled_with(block_id: u8) -> Self
pub const fn filled_with(block_id: u8) -> Self
Creates a new Chunk filled entirely with a block of the specified ID.
pub fn compress(&self) -> CompressedChunk<'_>
Sourcepub fn fill_with_params(&mut self, fill_params: FillParams<'_>)
pub fn fill_with_params(&mut self, fill_params: FillParams<'_>)
Fills the specified area from point a to point b with a block of the specified ID.
pub fn fill(&mut self, block_id: u8, rect: Rect4)
Trait Implementations§
Source§impl ChunkData for Chunk
impl ChunkData for Chunk
Source§fn decompressed(&self) -> Chunk
fn decompressed(&self) -> Chunk
Generate the equivalent decompressed chunk-data.
Because the data stored in this struct is already decompressed,
this method just returns a clone of the current Chunk object.
Source§fn from_bytes(bytes: &[u8]) -> Result<Self, ChunkReadError>where
Self: Sized,
fn from_bytes(bytes: &[u8]) -> Result<Self, ChunkReadError>where
Self: Sized,
Deserializes a slice of bytes into chunk-data.
impl Eq for Chunk
impl StructuralPartialEq for Chunk
Auto Trait Implementations§
impl Freeze for Chunk
impl RefUnwindSafe for Chunk
impl Send for Chunk
impl Sync for Chunk
impl Unpin for Chunk
impl UnwindSafe for Chunk
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