[][src]Struct sequoia_openpgp::packet::signature::subpacket::SubpacketArea

pub struct SubpacketArea {
    pub data: Vec<u8>,
    // some fields omitted
}

Subpacket area.

Fields

data: Vec<u8>

Raw, unparsed subpacket data.

Methods

impl SubpacketArea[src]

pub fn new(data: Vec<u8>) -> SubpacketArea[src]

Returns a new subpacket area based on data.

pub fn empty() -> SubpacketArea[src]

Returns a empty subpacket area.

impl SubpacketArea[src]

pub fn iter<'a>(&'a self) -> Iter<'a>[src]

Iterates over the subpackets.

pub fn lookup(&self, tag: SubpacketTag) -> Option<Subpacket>[src]

Returns the last subpacket, if any, with the specified tag.

pub fn add(&mut self, packet: Subpacket) -> Result<()>[src]

Adds the given subpacket.

Errors

Returns Error::MalformedPacket if adding the packet makes the subpacket area exceed the size limit.

pub fn replace(&mut self, packet: Subpacket) -> Result<()>[src]

Adds the given subpacket, replacing all other subpackets with the same tag.

Errors

Returns Error::MalformedPacket if adding the packet makes the subpacket area exceed the size limit.

pub fn remove_all(&mut self, tag: SubpacketTag) -> Vec<u8>[src]

Removes all subpackets with the given tag.

Returns the old subpacket area, so that it can be restored if necessary.

pub fn clear(&mut self)[src]

Removes all subpackets.

Trait Implementations

impl Clone for SubpacketArea[src]

impl Debug for SubpacketArea[src]

impl Eq for SubpacketArea[src]

impl<'a> FromIterator<(usize, usize, Subpacket<'a>)> for SubpacketArea[src]

impl Hash for SubpacketArea[src]

impl<'a> IntoIterator for &'a SubpacketArea[src]

type Item = (usize, usize, Subpacket<'a>)

The type of the elements being iterated over.

type IntoIter = Iter<'a>

Which kind of iterator are we turning this into?

impl PartialEq<SubpacketArea> for SubpacketArea[src]

impl StructuralEq for SubpacketArea[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.