pub struct Incompressible;Expand description
A strategy for encoding values that cannot be compressed.
Examples would be encrypted or random bytes. In this case, compactly
abandons any attempt at compression (e.g. variable bitlength) and also
adopts a faster algorithm where possible.
Note: there is a small 2-3 byte overhead (on an entire encoded value) for
using Incompressible at all. So ideally you would want to use it only
when the encoded size is significant (so a couple of extra bytes won’t
matter) and encoding and decoding speed is important.
Trait Implementations§
Source§impl Clone for Incompressible
impl Clone for Incompressible
Source§fn clone(&self) -> Incompressible
fn clone(&self) -> Incompressible
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 Incompressible
impl Debug for Incompressible
Source§impl Default for Incompressible
impl Default for Incompressible
Source§fn default() -> Incompressible
fn default() -> Incompressible
Returns the “default value” for a type. Read more
Source§impl EncodingStrategy<Vec<u8>> for Incompressible
impl EncodingStrategy<Vec<u8>> for Incompressible
Source§type Context = <Vec<u8> as Encode>::Context
type Context = <Vec<u8> as Encode>::Context
The conext (i.e. probability model) for this encoding strategy applied to this type.
Source§fn decode<R: Read>(
reader: &mut Reader<R>,
ctx: &mut Self::Context,
) -> Result<Vec<u8>, Error>
fn decode<R: Read>( reader: &mut Reader<R>, ctx: &mut Self::Context, ) -> Result<Vec<u8>, Error>
Decode the value using this strategy.
Source§impl EncodingStrategy<Vec<u8>> for Incompressible
impl EncodingStrategy<Vec<u8>> for Incompressible
Source§impl EncodingStrategy<u16> for Incompressible
impl EncodingStrategy<u16> for Incompressible
Source§type Context = Context
type Context = Context
The conext (i.e. probability model) for this encoding strategy applied to this type.
Source§fn encode<W: Write>(
value: &u16,
writer: &mut Writer<W>,
ctx: &mut Self::Context,
) -> Result<(), Error>
fn encode<W: Write>( value: &u16, writer: &mut Writer<W>, ctx: &mut Self::Context, ) -> Result<(), Error>
Encode the value with this strategy.
Source§impl EncodingStrategy<u16> for Incompressible
impl EncodingStrategy<u16> for Incompressible
Source§impl EncodingStrategy<u32> for Incompressible
impl EncodingStrategy<u32> for Incompressible
Source§type Context = Context
type Context = Context
The conext (i.e. probability model) for this encoding strategy applied to this type.
Source§fn encode<W: Write>(
value: &u32,
writer: &mut Writer<W>,
ctx: &mut Self::Context,
) -> Result<(), Error>
fn encode<W: Write>( value: &u32, writer: &mut Writer<W>, ctx: &mut Self::Context, ) -> Result<(), Error>
Encode the value with this strategy.
Source§impl EncodingStrategy<u32> for Incompressible
impl EncodingStrategy<u32> for Incompressible
Source§impl EncodingStrategy<u64> for Incompressible
impl EncodingStrategy<u64> for Incompressible
Source§type Context = Context
type Context = Context
The conext (i.e. probability model) for this encoding strategy applied to this type.
Source§fn encode<W: Write>(
value: &u64,
writer: &mut Writer<W>,
ctx: &mut Self::Context,
) -> Result<(), Error>
fn encode<W: Write>( value: &u64, writer: &mut Writer<W>, ctx: &mut Self::Context, ) -> Result<(), Error>
Encode the value with this strategy.
Source§impl EncodingStrategy<u64> for Incompressible
impl EncodingStrategy<u64> for Incompressible
Source§impl EncodingStrategy<u8> for Incompressible
impl EncodingStrategy<u8> for Incompressible
Source§type Context = ByteContext
type Context = ByteContext
The conext (i.e. probability model) for this encoding strategy applied to this type.
Source§fn encode<W: Write>(
value: &u8,
writer: &mut Writer<W>,
ctx: &mut Self::Context,
) -> Result<(), Error>
fn encode<W: Write>( value: &u8, writer: &mut Writer<W>, ctx: &mut Self::Context, ) -> Result<(), Error>
Encode the value with this strategy.
Source§impl EncodingStrategy<u8> for Incompressible
impl EncodingStrategy<u8> for Incompressible
Source§impl Hash for Incompressible
impl Hash for Incompressible
Source§impl Ord for Incompressible
impl Ord for Incompressible
Source§fn cmp(&self, other: &Incompressible) -> Ordering
fn cmp(&self, other: &Incompressible) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for Incompressible
impl PartialEq for Incompressible
Source§impl PartialOrd for Incompressible
impl PartialOrd for Incompressible
impl Copy for Incompressible
impl Eq for Incompressible
impl StructuralPartialEq for Incompressible
Auto Trait Implementations§
impl Freeze for Incompressible
impl RefUnwindSafe for Incompressible
impl Send for Incompressible
impl Sync for Incompressible
impl Unpin for Incompressible
impl UnsafeUnpin for Incompressible
impl UnwindSafe for Incompressible
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