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 9580 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
Implement IntoIterator
so that
cert::insert_packets(sig)
just works.
impl IntoIterator for Literal
Implement IntoIterator
so that
cert::insert_packets(sig)
just works.