pub struct Codecs { /* private fields */ }Expand description
Codecs by compression type number (0-63).
Implementations§
Source§impl Codecs
impl Codecs
Sourcepub fn set(
&mut self,
which: Codec,
codec: Arc<dyn BlockCodec>,
) -> Result<(), Codec>
pub fn set( &mut self, which: Codec, codec: Arc<dyn BlockCodec>, ) -> Result<(), Codec>
Registers codec for which (a custom codec is Codec::Other(5..=63);
a codec for Codec::None replaces how stored blocks decode, as a
caller may replace UnityPy’s DECOMPRESSION_MAP[NONE]). A
non-canonical value (Other(n) with n below 5 or above 63) names no
slot and is handed back.
Sourcepub fn stores_as_is(&self) -> bool
pub fn stores_as_is(&self) -> bool
Whether a stored block (type 0) is its own bytes: slot 0 holds the
built-in Stored of Self::unitypy, so a bundle may take such a
block as a slice of its input, and its length as what was read,
without calling the codec. Otherwise (a codec registered over it, or
none) every stored block goes through slot 0 as any block goes
through its codec, lazily as eagerly, as UnityPy’s eager load sends
every block through DECOMPRESSION_MAP.