Enum twmap::CompressedData
source · 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§
Implementations§
source§impl<T> CompressedData<Array2<T>, TilesLoadInfo>
impl<T> CompressedData<Array2<T>, TilesLoadInfo>
source§impl<T, U> CompressedData<T, U>
impl<T, U> CompressedData<T, U>
sourcepub const fn unwrap_ref(&self) -> &T
pub const fn unwrap_ref(&self) -> &T
Returns a reference to the inner loaded value. Panics if isn’t loaded.
sourcepub fn unwrap_mut(&mut self) -> &mut T
pub fn unwrap_mut(&mut self) -> &mut T
Returns a mutable reference to the inner loaded value. Panics if isn’t loaded.
Trait Implementations§
source§impl<T: Clone, U: Clone> Clone for CompressedData<T, U>
impl<T: Clone, U: Clone> Clone for CompressedData<T, U>
source§fn clone(&self) -> CompressedData<T, U>
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)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<'de, T, U> Deserialize<'de> for CompressedData<T, U>where
T: Deserialize<'de>,
U: Deserialize<'de>,
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>,
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>
impl<T, U> From<T> for CompressedData<T, U>
source§impl<T: PartialEq, U: PartialEq> PartialEq for CompressedData<T, U>
impl<T: PartialEq, U: PartialEq> PartialEq for CompressedData<T, U>
source§fn eq(&self, other: &CompressedData<T, U>) -> bool
fn eq(&self, other: &CompressedData<T, U>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<T, U> Serialize for CompressedData<T, U>
impl<T, U> Serialize for CompressedData<T, U>
impl<T: Eq, U: Eq> Eq for CompressedData<T, U>
impl<T, U> StructuralPartialEq for CompressedData<T, U>
Auto Trait Implementations§
impl<T, U> Freeze for CompressedData<T, U>
impl<T, U> RefUnwindSafe for CompressedData<T, U>where
U: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, U> Send for CompressedData<T, U>
impl<T, U> Sync for CompressedData<T, U>
impl<T, U> Unpin for CompressedData<T, U>
impl<T, U> UnwindSafe for CompressedData<T, U>where
U: UnwindSafe,
T: UnwindSafe,
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> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Casts the value.
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
source§impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
source§fn lossless_try_into(self) -> Option<Dst>
fn lossless_try_into(self) -> Option<Dst>
Performs the conversion.
source§impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
source§fn lossy_into(self) -> Dst
fn lossy_into(self) -> Dst
Performs the conversion.
source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Casts the value.
source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Casts the value.
source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
Casts the value.
source§impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
source§fn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
Casts the value.
source§impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
source§fn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.