pub enum CompressedData<T, U> {
    Compressed(Vec<u8>, usize, U),
    Loaded(T),
}
Expand description

Holds compressed data. Use Load or LoadMultiple to decompress this. Too construct with the already loaded data, simply use CompressedData::from.

Variants§

§

Compressed(Vec<u8>, usize, U)

§

Loaded(T)

Implementations§

source§

impl<T> CompressedData<Array2<T>, TilesLoadInfo>

source

pub fn shape(&self) -> Extent2<usize>

Returns the (height, width) 2-dimensional array of tiles.

source§

impl<T, U> CompressedData<T, U>

source

pub const fn unwrap_ref(&self) -> &T

Returns a reference to the inner loaded value. Panics if isn’t loaded.

source

pub fn unwrap_mut(&mut self) -> &mut T

Returns a mutable reference to the inner loaded value. Panics if isn’t loaded.

source

pub fn unwrap(self) -> T

Returns the inner loaded value. Panics if isn’t loaded.

Trait Implementations§

source§

impl<T: Clone, U: Clone> Clone for CompressedData<T, U>

source§

fn clone(&self) -> CompressedData<T, U>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: Debug, U: Debug> Debug for CompressedData<T, U>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de, T, U> Deserialize<'de> for CompressedData<T, U>
where T: Deserialize<'de>, U: Deserialize<'de>,

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<T, U> From<T> for CompressedData<T, U>

source§

fn from(data: T) -> Self

Converts to this type from the input type.
source§

impl<T: PartialEq, U: PartialEq> PartialEq for CompressedData<T, U>

source§

fn eq(&self, other: &CompressedData<T, U>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T, U> Serialize for CompressedData<T, U>
where T: Serialize, U: Serialize,

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<T: Eq, U: Eq> Eq for CompressedData<T, U>

source§

impl<T, U> StructuralEq for CompressedData<T, U>

source§

impl<T, U> StructuralPartialEq for CompressedData<T, U>

Auto Trait Implementations§

§

impl<T, U> RefUnwindSafe for CompressedData<T, U>

§

impl<T, U> Send for CompressedData<T, U>
where T: Send, U: Send,

§

impl<T, U> Sync for CompressedData<T, U>
where T: Sync, U: Sync,

§

impl<T, U> Unpin for CompressedData<T, U>
where T: Unpin, U: Unpin,

§

impl<T, U> UnwindSafe for CompressedData<T, U>
where T: UnwindSafe, U: UnwindSafe,

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> Az for T

source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
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<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

source§

fn cast_from(src: Src) -> Dst

Casts the value.
source§

impl<T> CheckedAs for T

source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
source§

impl<T> From<!> for T

source§

fn from(t: !) -> T

Converts to this type from the input type.
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> Load for T
where T: InternalLoad,

source§

fn load_unchecked(&mut self) -> Result<(), MapError>

source§

fn load(&mut self) -> Result<(), MapError>

source§

impl<Src, Dst> LosslessTryInto<Dst> for Src
where Dst: LosslessTryFrom<Src>,

source§

fn lossless_try_into(self) -> Option<Dst>

Performs the conversion.
source§

impl<Src, Dst> LossyInto<Dst> for Src
where Dst: LossyFrom<Src>,

source§

fn lossy_into(self) -> Dst

Performs the conversion.
source§

impl<T> OverflowingAs for T

source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> SaturatingAs for T

source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
source§

impl<T> To for T

source§

fn to<T>(self) -> T
where Self: Into<T> + Sized,

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
source§

impl<T> TryTo for T

source§

fn try_to<T>(self) -> T
where Self: TryInto<T> + Sized, <Self as TryInto<T>>::Error: Debug,

source§

impl<T> UnwrappedAs for T

source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
source§

impl<T> WrappingAs for T

source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,