pub enum StreamEncoding {
Identity,
Deflate12c,
Zstd20c,
}Expand description
One direction’s stream encoding, named by its preface token.
Variants§
Identity
Plain ILTP bytes. Always available and implied by every offer.
Deflate12c
Raw deflate (RFC 1951) with a 4 KiB window, sync flushes and the preset dictionary.
Zstd20c
Magicless zstd (RFC 8878) with at most a 1 MiB window, no checksum, content size or dictionary ID, and the raw-content preset dictionary.
Implementations§
Source§impl StreamEncoding
impl StreamEncoding
pub fn token(self) -> &'static str
Sourcepub fn from_token(token: &str) -> Option<Self>
pub fn from_token(token: &str) -> Option<Self>
Parse a token; tokens unknown to this build return None.
Sourcepub fn parse_list<'a>(
tokens: impl IntoIterator<Item = &'a str>,
) -> Result<Vec<Self>, &'static str>
pub fn parse_list<'a>( tokens: impl IntoIterator<Item = &'a str>, ) -> Result<Vec<Self>, &'static str>
Parse one configured token list: the encode preference and decode set
of a carrier. Tokens unknown to this build, identity, and repeats are
errors.
Trait Implementations§
Source§impl Clone for StreamEncoding
impl Clone for StreamEncoding
Source§fn clone(&self) -> StreamEncoding
fn clone(&self) -> StreamEncoding
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for StreamEncoding
Source§impl Debug for StreamEncoding
impl Debug for StreamEncoding
impl Eq for StreamEncoding
Source§impl Hash for StreamEncoding
impl Hash for StreamEncoding
Source§impl PartialEq for StreamEncoding
impl PartialEq for StreamEncoding
Source§fn eq(&self, other: &StreamEncoding) -> bool
fn eq(&self, other: &StreamEncoding) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for StreamEncoding
Auto Trait Implementations§
impl Freeze for StreamEncoding
impl RefUnwindSafe for StreamEncoding
impl Send for StreamEncoding
impl Sync for StreamEncoding
impl Unpin for StreamEncoding
impl UnsafeUnpin for StreamEncoding
impl UnwindSafe for StreamEncoding
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