Struct level_lib::anvil::region::Region

source ·
pub struct Region { /* private fields */ }
Expand description

A structure that holds region data

Implementations§

source§

impl Region

source

pub fn new() -> Self

creating a new instance of itself

source

pub fn add_chunk( &mut self, (x, z): (i64, i64), ((compression, data), timestamp): ((CompressionScheme, Vec<u8>), SystemTime) )

Adds chunk data to a region

Methods from Deref<Target = LocationAndTimestampTable>§

source

pub fn get(&self, x: isize, z: isize) -> Location

Returns the requested chunk of a region

source

pub fn set(&mut self, x: isize, z: isize, value: Location)

Sets the location of a chunk

source

pub fn get_timestamp(&self, x: isize, z: isize) -> u32

Returns the requested timestamp of a region

source

pub fn get_timestamp_time(&self, x: isize, z: isize) -> SystemTime

Returns the requested timestamp of a region as SystemTime

source

pub fn set_timestamp(&mut self, x: isize, z: isize, value: u32)

Sets the timestamp of a chunk

source

pub fn set_timestamp_table(&mut self, value: [u32; 1024])

Set the timestamp table

Trait Implementations§

source§

impl Deref for Region

§

type Target = LocationAndTimestampTable

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl DerefMut for Region

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.

Auto Trait Implementations§

§

impl Freeze for Region

§

impl RefUnwindSafe for Region

§

impl Send for Region

§

impl Sync for Region

§

impl Unpin for Region

§

impl UnwindSafe for Region

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.