Struct sequoia_openpgp::packet::Literal
source · pub struct Literal { /* private fields */ }
Expand description
Holds a literal packet.
A literal packet contains unstructured data. Since the size can
be very large, it is advised to process messages containing such
packets using a PacketParser
or a PacketPileParser
and process
the data in a streaming manner rather than the using the
PacketPile::from_file
and related interfaces.
See Section 5.9 of RFC 4880 for details.
Implementations§
source§impl Literal
impl Literal
sourcepub fn new(format: DataFormat) -> Literal
pub fn new(format: DataFormat) -> Literal
Returns a new Literal
packet.
sourcepub fn format(&self) -> DataFormat
pub fn format(&self) -> DataFormat
Gets the Literal packet’s content disposition.
sourcepub fn set_format(&mut self, format: DataFormat) -> DataFormat
pub fn set_format(&mut self, format: DataFormat) -> DataFormat
Sets the Literal packet’s content disposition.
sourcepub fn filename(&self) -> Option<&[u8]>
pub fn filename(&self) -> Option<&[u8]>
Gets the literal packet’s filename.
Note: when a literal data packet is protected by a signature, only the literal data packet’s body is protected, not the meta-data. As such, this field should normally be ignored.
sourcepub fn set_filename<F>(&mut self, filename: F) -> Result<Option<Vec<u8>>>
pub fn set_filename<F>(&mut self, filename: F) -> Result<Option<Vec<u8>>>
Sets the literal packet’s filename field.
The standard does not specify the encoding. Filenames must not be longer than 255 bytes.
Note: when a literal data packet is protected by a signature, only the literal data packet’s body is protected, not the meta-data. As such, this field should not be used.
sourcepub fn date(&self) -> Option<SystemTime>
pub fn date(&self) -> Option<SystemTime>
Gets the literal packet’s date field.
Note: when a literal data packet is protected by a signature, only the literal data packet’s body is protected, not the meta-data. As such, this field should normally be ignored.
sourcepub fn set_date<T>(&mut self, timestamp: T) -> Result<Option<SystemTime>>
pub fn set_date<T>(&mut self, timestamp: T) -> Result<Option<SystemTime>>
Sets the literal packet’s date field.
Note: when a literal data packet is protected by a signature, only the literal data packet’s body is protected, not the meta-data. As such, this field should not be used.
Trait Implementations§
source§impl Any<Literal> for Packet
impl Any<Literal> for Packet
source§impl IntoIterator for Literal
impl IntoIterator for Literal
Implement IntoIterator
so that
cert::insert_packets(sig)
just works.