pub trait Deserializable: Sized {
    // Required method
    fn from_packets<'a, I: Iterator<Item = Result<Packet>> + 'a>(
        packets: Peekable<I>
    ) -> Box<dyn Iterator<Item = Result<Self>> + 'a>;

    // Provided methods
    fn from_bytes(bytes: impl Read) -> Result<Self> { ... }
    fn from_string(input: &str) -> Result<(Self, BTreeMap<String, String>)> { ... }
    fn from_string_many<'a>(
        input: &'a str
    ) -> Result<(Box<dyn Iterator<Item = Result<Self>> + 'a>, BTreeMap<String, String>)> { ... }
    fn from_armor_single<R: Read + Seek>(
        input: R
    ) -> Result<(Self, BTreeMap<String, String>)> { ... }
    fn from_armor_many<'a, R: Read + Seek + 'a>(
        input: R
    ) -> Result<(Box<dyn Iterator<Item = Result<Self>> + 'a>, BTreeMap<String, String>)> { ... }
    fn from_bytes_many<'a>(
        bytes: impl Read + 'a
    ) -> Box<dyn Iterator<Item = Result<Self>> + 'a> { ... }
    fn from_reader_single<'a, R: Read + Seek + 'a>(
        input: R
    ) -> Result<(Self, Option<BTreeMap<String, String>>)> { ... }
    fn from_reader_many<'a, R: Read + Seek + 'a>(
        input: R
    ) -> Result<(Box<dyn Iterator<Item = Result<Self>> + 'a>, Option<BTreeMap<String, String>>)> { ... }
}

Required Methods§

source

fn from_packets<'a, I: Iterator<Item = Result<Packet>> + 'a>( packets: Peekable<I> ) -> Box<dyn Iterator<Item = Result<Self>> + 'a>

Turn a list of packets into a usable representation.

Provided Methods§

source

fn from_bytes(bytes: impl Read) -> Result<Self>

Parse a single byte encoded composition.

source

fn from_string(input: &str) -> Result<(Self, BTreeMap<String, String>)>

Parse a single armor encoded composition.

source

fn from_string_many<'a>( input: &'a str ) -> Result<(Box<dyn Iterator<Item = Result<Self>> + 'a>, BTreeMap<String, String>)>

Parse an armor encoded list of compositions.

source

fn from_armor_single<R: Read + Seek>( input: R ) -> Result<(Self, BTreeMap<String, String>)>

Armored ascii data.

source

fn from_armor_many<'a, R: Read + Seek + 'a>( input: R ) -> Result<(Box<dyn Iterator<Item = Result<Self>> + 'a>, BTreeMap<String, String>)>

Armored ascii data.

source

fn from_bytes_many<'a>( bytes: impl Read + 'a ) -> Box<dyn Iterator<Item = Result<Self>> + 'a>

Parse a list of compositions in raw byte format.

source

fn from_reader_single<'a, R: Read + Seek + 'a>( input: R ) -> Result<(Self, Option<BTreeMap<String, String>>)>

Parses a single composition, from either ASCII-armored or binary OpenPGP data.

Returns a composition and a BTreeMap containing armor headers (None, if the data was unarmored)

source

fn from_reader_many<'a, R: Read + Seek + 'a>( input: R ) -> Result<(Box<dyn Iterator<Item = Result<Self>> + 'a>, Option<BTreeMap<String, String>>)>

Parses a list of compositions, from either ASCII-armored or binary OpenPGP data.

Returns an iterator of compositions and a BTreeMap containing armor headers (None, if the data was unarmored)

Object Safety§

This trait is not object safe.

Implementors§