pub struct RegionWriter { /* private fields */ }
Expand description
A writer used to write chunks to a region (mca
) file.
Implementations§
Source§impl RegionWriter
impl RegionWriter
Sourcepub fn new() -> RegionWriter
pub fn new() -> RegionWriter
Creates a new region writer
Sourcepub fn push_chunk(
&mut self,
raw_data: &[u8],
coordinate: (u8, u8),
) -> Result<(), McaError>
pub fn push_chunk( &mut self, raw_data: &[u8], coordinate: (u8, u8), ) -> Result<(), McaError>
Pushes a raw chunk into the writer
Defaults to LZ4
compression, use [push_chunk_with_compression
] for other compression types.
Timestamp will be current time since UNIX_EPOCH
, use [push_pending_chunk
] to override it.
Sourcepub fn push_chunk_with_compression(
&mut self,
raw_data: &[u8],
coordinate: (u8, u8),
compression_type: CompressionType,
) -> Result<(), McaError>
pub fn push_chunk_with_compression( &mut self, raw_data: &[u8], coordinate: (u8, u8), compression_type: CompressionType, ) -> Result<(), McaError>
Pushes a raw chunk into the writer
This specifies the compression type used
Sourcepub fn push_pending_chunk(&mut self, chunk: PendingChunk)
pub fn push_pending_chunk(&mut self, chunk: PendingChunk)
Just pushes a PendingChunk
to the writer
Trait Implementations§
Source§impl Clone for RegionWriter
impl Clone for RegionWriter
Source§fn clone(&self) -> RegionWriter
fn clone(&self) -> RegionWriter
Returns a copy of the value. Read more
1.0.0 · 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 RegionWriter
impl Debug for RegionWriter
Source§impl Ord for RegionWriter
impl Ord for RegionWriter
Source§fn cmp(&self, other: &RegionWriter) -> Ordering
fn cmp(&self, other: &RegionWriter) -> Ordering
1.21.0 · 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 RegionWriter
impl PartialEq for RegionWriter
Source§impl PartialOrd for RegionWriter
impl PartialOrd for RegionWriter
impl Eq for RegionWriter
impl StructuralPartialEq for RegionWriter
Auto Trait Implementations§
impl Freeze for RegionWriter
impl RefUnwindSafe for RegionWriter
impl Send for RegionWriter
impl Sync for RegionWriter
impl Unpin for RegionWriter
impl UnwindSafe for RegionWriter
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