pub enum WireCompression {
None,
Deflate,
Lz4,
Zstd,
}Expand description
The compression codec for an encoded body — the sender’s dial. The wire is
self-describing (the header carries the codec), so this is purely a sender
preference; any peer decodes any codec. Each is kept only if it actually shrank
the body (see message_to_wire_with), so compression never hurts the fast path.
Variants§
None
No compression. The default — our binary is already compact, so compression is for large/redundant payloads on size-constrained links.
Deflate
DEFLATE (miniz_oxide). The balanced middle; what Send compressed selects.
Lz4
LZ4 (lz4_flex, pure-Rust) — near-memcpy speed, lighter ratio. Ships on every
target (native + browser).
Zstd
Zstandard — the best ratio. Native uses the C encoder; the browser cannot
encode it (falls back to lz4) but decodes it via the pure-Rust ruzstd.
Trait Implementations§
Source§impl Clone for WireCompression
impl Clone for WireCompression
Source§fn clone(&self) -> WireCompression
fn clone(&self) -> WireCompression
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WireCompression
impl Debug for WireCompression
Source§impl PartialEq for WireCompression
impl PartialEq for WireCompression
Source§fn eq(&self, other: &WireCompression) -> bool
fn eq(&self, other: &WireCompression) -> bool
self and other values to be equal, and is used by ==.impl Copy for WireCompression
impl Eq for WireCompression
impl StructuralPartialEq for WireCompression
Auto Trait Implementations§
impl Freeze for WireCompression
impl RefUnwindSafe for WireCompression
impl Send for WireCompression
impl Sync for WireCompression
impl Unpin for WireCompression
impl UnsafeUnpin for WireCompression
impl UnwindSafe for WireCompression
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.