pub enum SerializedData {
Compressed(CompressionMode, Vec<u8>),
Uncompressed(Vec<u8>),
}Expand description
Represents serialized asset data that can be either compressed or uncompressed.
This enum uses serde’s untagged serialization, meaning the variant is determined by the structure of the data rather than an explicit tag field.
Variants§
Compressed(CompressionMode, Vec<u8>)
Compressed data variant containing compression mode and compressed bytes
Tuple Fields
§
0: CompressionModeThe compression algorithm used to compress the data
Uncompressed(Vec<u8>)
Uncompressed data variant containing raw bytes
Implementations§
Source§impl SerializedData
impl SerializedData
Sourcepub fn compression_mode(&self) -> Option<CompressionMode>
pub fn compression_mode(&self) -> Option<CompressionMode>
Returns the compression mode if the data is compressed, or None if uncompressed.
This method allows checking whether the serialized data uses compression and which compression algorithm was applied.
Trait Implementations§
Source§impl Clone for SerializedData
impl Clone for SerializedData
Source§fn clone(&self) -> SerializedData
fn clone(&self) -> SerializedData
Returns a duplicate 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 SerializedData
impl Debug for SerializedData
Source§impl<'de> Deserialize<'de> for SerializedData
impl<'de> Deserialize<'de> for SerializedData
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 PartialEq for SerializedData
impl PartialEq for SerializedData
Source§impl PartialOrd for SerializedData
impl PartialOrd for SerializedData
Source§impl Serialize for SerializedData
impl Serialize for SerializedData
impl StructuralPartialEq for SerializedData
Auto Trait Implementations§
impl Freeze for SerializedData
impl RefUnwindSafe for SerializedData
impl Send for SerializedData
impl Sync for SerializedData
impl Unpin for SerializedData
impl UnsafeUnpin for SerializedData
impl UnwindSafe for SerializedData
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.