Struct sequoia_openpgp::packet::prelude::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
sourceimpl 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
sourceimpl Any<CompressedData> for Packet
impl Any<CompressedData> for Packet
sourcefn downcast(self) -> Result<CompressedData, Packet>
fn downcast(self) -> Result<CompressedData, Packet>
Attempts to downcast to T
, returning the packet if it fails. Read more
sourcefn downcast_ref(&self) -> Option<&CompressedData>
fn downcast_ref(&self) -> Option<&CompressedData>
Attempts to downcast to &T
, returning None
if it fails. Read more
sourcefn downcast_mut(&mut self) -> Option<&mut CompressedData>
fn downcast_mut(&mut self) -> Option<&mut CompressedData>
Attempts to downcast to &mut T
, returning None
if it fails. Read more
sourceimpl Clone for CompressedData
impl Clone for CompressedData
sourcefn clone(&self) -> CompressedData
fn clone(&self) -> CompressedData
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for CompressedData
impl Debug for CompressedData
sourceimpl Deref for CompressedData
impl Deref for CompressedData
sourceimpl DerefMut for CompressedData
impl DerefMut for CompressedData
sourceimpl From<CompressedData> for Packet
impl From<CompressedData> for Packet
sourcefn from(s: CompressedData) -> Self
fn from(s: CompressedData) -> Self
Converts to this type from the input type.
sourceimpl Hash for CompressedData
impl Hash for CompressedData
sourceimpl IntoIterator for CompressedData
impl IntoIterator for CompressedData
Implement IntoIterator
so that
cert::insert_packets(sig)
just works.
type Item = CompressedData
type Item = CompressedData
The type of the elements being iterated over.
type IntoIter = Once<CompressedData>
type IntoIter = Once<CompressedData>
Which kind of iterator are we turning this into?
sourceimpl Marshal for CompressedData
impl Marshal for CompressedData
sourceimpl MarshalInto for CompressedData
impl MarshalInto for CompressedData
sourcefn 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.
sourcefn serialize_into(&self, buf: &mut [u8]) -> Result<usize>
fn serialize_into(&self, buf: &mut [u8]) -> Result<usize>
Serializes into the given buffer. Read more
sourceimpl<'a> Parse<'a, CompressedData> for CompressedData
impl<'a> Parse<'a, CompressedData> for CompressedData
sourceimpl PartialEq<CompressedData> for CompressedData
impl PartialEq<CompressedData> for CompressedData
sourcefn eq(&self, other: &CompressedData) -> bool
fn eq(&self, other: &CompressedData) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &CompressedData) -> bool
fn ne(&self, other: &CompressedData) -> bool
This method tests for !=
.
impl Eq for CompressedData
impl StructuralEq for CompressedData
impl StructuralPartialEq for CompressedData
Auto Trait Implementations
impl RefUnwindSafe for CompressedData
impl Send for CompressedData
impl Sync for CompressedData
impl Unpin for CompressedData
impl UnwindSafe for CompressedData
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more