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.
source§impl MarshalInto for Literal
impl MarshalInto for Literal
source§fn serialized_len(&self) -> usize
fn serialized_len(&self) -> usize
source§fn serialize_into(&self, buf: &mut [u8]) -> Result<usize>
fn serialize_into(&self, buf: &mut [u8]) -> Result<usize>
source§impl<'a> Parse<'a, Literal> for Literal
impl<'a> Parse<'a, Literal> for Literal
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 Literal
impl PartialEq for Literal
impl Eq for Literal
impl StructuralPartialEq for Literal
Auto Trait Implementations§
impl Freeze for Literal
impl RefUnwindSafe for Literal
impl Send for Literal
impl Sync for Literal
impl Unpin for Literal
impl UnwindSafe for Literal
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
)