Trait Deserializable

Source
pub trait Deserializable: Sized {
Show 14 methods // Required methods fn from_packets<'a, I: Iterator<Item = Result<Packet>> + 'a>( packets: Peekable<I>, ) -> Box<dyn Iterator<Item = Result<Self>> + 'a>; fn matches_block_type(typ: BlockType) -> bool; // Provided methods fn from_bytes(bytes: impl Read) -> Result<Self> { ... } fn from_string(input: &str) -> Result<(Self, Headers)> { ... } fn from_string_many<'a>( input: &'a str, ) -> Result<(Box<dyn Iterator<Item = Result<Self>> + 'a>, Headers)> { ... } fn from_armor_single<R: Read>(input: R) -> Result<(Self, Headers)> { ... } fn from_armor_single_buf<R: BufRead>(input: R) -> Result<(Self, Headers)> { ... } fn from_armor_many<'a, R: Read + 'a>( input: R, ) -> Result<(Box<dyn Iterator<Item = Result<Self>> + 'a>, Headers)> { ... } fn from_armor_many_buf<'a, R: BufRead + 'a>( input: R, ) -> Result<(Box<dyn Iterator<Item = Result<Self>> + 'a>, Headers)> { ... } fn from_bytes_many<'a>( bytes: impl Read + 'a, ) -> Box<dyn Iterator<Item = Result<Self>> + 'a> { ... } fn from_reader_single<'a, R: Read + 'a>( input: R, ) -> Result<(Self, Option<Headers>)> { ... } fn from_reader_single_buf<'a, R: BufRead + 'a>( input: R, ) -> Result<(Self, Option<Headers>)> { ... } fn from_reader_many<'a, R: Read + 'a>( input: R, ) -> Result<(Box<dyn Iterator<Item = Result<Self>> + 'a>, Option<Headers>)> { ... } fn from_reader_many_buf<'a, R: BufRead + 'a>( input: R, ) -> Result<(Box<dyn Iterator<Item = Result<Self>> + 'a>, Option<Headers>)> { ... }
}

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.

Source

fn matches_block_type(typ: BlockType) -> bool

Check if the given typ is a valid block type for this type.

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, Headers)>

Parse a single armor encoded composition.

Source

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

Parse an armor encoded list of compositions.

Source

fn from_armor_single<R: Read>(input: R) -> Result<(Self, Headers)>

Armored ascii data.

Source

fn from_armor_single_buf<R: BufRead>(input: R) -> Result<(Self, Headers)>

Armored ascii data.

Source

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

Armored ascii data.

Source

fn from_armor_many_buf<'a, R: BufRead + 'a>( input: R, ) -> Result<(Box<dyn Iterator<Item = Result<Self>> + 'a>, Headers)>

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 + 'a>( input: R, ) -> Result<(Self, Option<Headers>)>

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_single_buf<'a, R: BufRead + 'a>( input: R, ) -> Result<(Self, Option<Headers>)>

Source

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

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)

Source

fn from_reader_many_buf<'a, R: BufRead + 'a>( input: R, ) -> Result<(Box<dyn Iterator<Item = Result<Self>> + 'a>, Option<Headers>)>

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)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§