#[non_exhaustive]pub enum TransferEncoding {
Identity,
Base64,
Zlib {
png_predictor_columns: Option<u32>,
},
Deflate,
Gzip,
Brotli,
Unknown(Cow<'static, str>),
}Expand description
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Identity
Stored as is.
Base64
Standard base64 (RFC 4648 alphabet, with padding), as SVG stores a manifest. Whitespace is ignored when decoding.
Zlib
A zlib stream (RFC 1950), as PDF FlateDecode stores a stream, optionally
followed by PNG predictor rows of this many 8-bit single-component columns
(PDF Predictor 10 to 15).
Fields
Deflate
A raw deflate stream (RFC 1951). Decoding also accepts a zlib-wrapped stream,
recognised by a valid zlib header, since some writers label zlib data
deflate.
Gzip
A gzip stream (RFC 1952).
Brotli
A Brotli stream (RFC 7932).
Unknown(Cow<'static, str>)
An encoding the core does not know, with the label the format gave it
(printable ASCII, at most MAX_LABEL_LEN bytes).
Implementations§
Source§impl TransferEncoding
impl TransferEncoding
Sourcepub fn unknown(label: &str) -> Option<Self>
pub fn unknown(label: &str) -> Option<Self>
An Unknown encoding labelled label, or None if the label
is empty, longer than MAX_LABEL_LEN or not printable ASCII.
Sourcepub fn as_str(&self) -> &'static str
pub fn as_str(&self) -> &'static str
"identity", "base64", "zlib", "deflate", "gzip", "brotli" or
"unknown".
Sourcepub fn unknown_name(&self) -> Option<&str>
pub fn unknown_name(&self) -> Option<&str>
The native label of an Unknown encoding.
Sourcepub fn decode(&self, stored: Vec<u8>) -> Result<Vec<u8>>
pub fn decode(&self, stored: Vec<u8>) -> Result<Vec<u8>>
The content of stored bytes. Decompressed content is bounded by
MAX_DECODED_LEN. An encoding whose decoder is not built in (see the type’s
documentation), and an Unknown one, is
Error::UnsupportedFeature.