Struct sequoia_openpgp::packet::CompressedData
source · 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 4880 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.
Methods from Deref<Target = Container>§
sourcepub fn children_ref(&self) -> Option<&[Packet]>
pub fn children_ref(&self) -> Option<&[Packet]>
Returns a reference to this Packet’s children.
Returns None
if the body is not structured.
sourcepub fn children_mut(&mut self) -> Option<&mut Vec<Packet>>
pub fn children_mut(&mut self) -> Option<&mut Vec<Packet>>
Returns a mutable reference to this Packet’s children.
Returns None
if the body is not structured.
sourcepub fn descendants(&self) -> Option<Iter<'_>>
pub fn descendants(&self) -> Option<Iter<'_>>
Returns an iterator over the packet’s descendants. The descendants are visited in depth-first order.
Returns None
if the body is not structured.
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 DerefMut for CompressedData
impl DerefMut 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
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.
source§fn serialize_into(&self, buf: &mut [u8]) -> Result<usize>
fn serialize_into(&self, buf: &mut [u8]) -> Result<usize>
source§impl<'a> Parse<'a, CompressedData> for CompressedData
impl<'a> Parse<'a, CompressedData> for CompressedData
source§fn from_buffered_reader<R>(reader: R) -> Result<Self>where
R: BufferedReader<Cookie> + 'a,
fn from_buffered_reader<R>(reader: R) -> Result<Self>where
R: BufferedReader<Cookie> + 'a,
source§fn from_reader<R: 'a + Read + Send + Sync>(reader: R) -> Result<Self>
fn from_reader<R: 'a + Read + Send + Sync>(reader: R) -> Result<Self>
source§impl PartialEq for CompressedData
impl PartialEq for CompressedData
source§fn eq(&self, other: &CompressedData) -> bool
fn eq(&self, other: &CompressedData) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Deref for CompressedData
impl Deref for CompressedData
impl Eq for CompressedData
impl StructuralPartialEq for CompressedData
Auto Trait Implementations§
impl Freeze for CompressedData
impl RefUnwindSafe for CompressedData
impl Send for CompressedData
impl Sync for CompressedData
impl Unpin for CompressedData
impl UnwindSafe for CompressedData
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,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)