pub struct CompressedData { /* private fields */ }
Expand description
Holds a compressed data packet.
A compressed data packet is a container. See Section 5.6 of RFC 9580 for details.
When the parser encounters a compressed data packet with an
unknown compress algorithm, it returns an Unknown
packet instead
of a CompressedData
packet.
Implementations§
Source§impl CompressedData
impl CompressedData
Sourcepub fn new(algo: CompressionAlgorithm) -> Self
pub fn new(algo: CompressionAlgorithm) -> Self
Returns a new CompressedData
packet.
Sourcepub fn algo(&self) -> CompressionAlgorithm
pub fn algo(&self) -> CompressionAlgorithm
Gets the compression algorithm.
Sourcepub fn set_algo(&mut self, algo: CompressionAlgorithm) -> CompressionAlgorithm
pub fn set_algo(&mut self, algo: CompressionAlgorithm) -> CompressionAlgorithm
Sets the compression algorithm.
Source§impl CompressedData
This packet implements the processed container
interface.
impl CompressedData
This packet implements the processed container interface.
Container packets like this one can contain either unprocessed or processed, structured data.
Sourcepub fn container_ref(&self) -> &Container
pub fn container_ref(&self) -> &Container
Returns a reference to the container.
Sourcepub fn container_mut(&mut self) -> &mut Container
pub fn container_mut(&mut self) -> &mut Container
Returns a mutable reference to the container.
Trait Implementations§
Source§impl Any<CompressedData> for Packet
impl Any<CompressedData> for Packet
Source§fn downcast(self) -> Result<CompressedData, Packet>
fn downcast(self) -> Result<CompressedData, Packet>
T
, returning the packet if it fails. Read moreSource§fn downcast_ref(&self) -> Option<&CompressedData>
fn downcast_ref(&self) -> Option<&CompressedData>
Source§fn downcast_mut(&mut self) -> Option<&mut CompressedData>
fn downcast_mut(&mut self) -> Option<&mut CompressedData>
Source§impl Clone for CompressedData
impl Clone for CompressedData
Source§fn clone(&self) -> CompressedData
fn clone(&self) -> CompressedData
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for CompressedData
impl Debug for CompressedData
Source§impl From<CompressedData> for Packet
impl From<CompressedData> for Packet
Source§fn from(s: CompressedData) -> Self
fn from(s: CompressedData) -> Self
Source§impl Hash for CompressedData
impl Hash for CompressedData
Source§impl IntoIterator for CompressedData
Implement IntoIterator
so that
cert::insert_packets(sig)
just works.
impl IntoIterator for CompressedData
Implement IntoIterator
so that
cert::insert_packets(sig)
just works.
Source§impl Marshal for CompressedData
impl Marshal for CompressedData
Source§impl MarshalInto for CompressedData
impl MarshalInto for CompressedData
Source§fn serialized_len(&self) -> usize
fn serialized_len(&self) -> usize
Computes the maximal length of the serialized representation.
The size of the serialized compressed data packet is tricky to predict. First, it depends on the data being compressed. Second, we emit partial body encoded data.
This function tries overestimates the length. However, it may
happen that serialize_into()
fails.
§Errors
If serialization would fail, this function returns 0.