Skip to main content

Deserializable

Trait Deserializable 

pub trait Deserializable: Sized {
Show 20 methods // Required methods fn from_packets<'a, I>( packets: Peekable<I>, ) -> Box<dyn Iterator<Item = Result<Self, Error>> + 'a> where I: Iterator<Item = Result<Packet, Error>> + 'a; fn matches_block_type(typ: BlockType) -> bool; // Provided methods fn from_bytes<R>(bytes: R) -> Result<Self, Error> where R: BufRead { ... } fn from_string( input: &str, ) -> Result<(Self, BTreeMap<String, Vec<String>>), Error> { ... } fn from_string_many<'a>( input: &'a str, ) -> Result<(Box<dyn Iterator<Item = Result<Self, Error>> + 'a>, BTreeMap<String, Vec<String>>), Error> { ... } fn from_armor_single<R>( input: R, ) -> Result<(Self, BTreeMap<String, Vec<String>>), Error> where R: Read { ... } fn from_armor_single_buf<R>( input: R, ) -> Result<(Self, BTreeMap<String, Vec<String>>), Error> where R: BufRead { ... } fn from_armor_single_buf_with_options<R>( input: R, opt: DearmorOptions, ) -> Result<(Self, BTreeMap<String, Vec<String>>), Error> where R: BufRead { ... } fn from_armor_many<'a, R>( input: R, ) -> Result<(Box<dyn Iterator<Item = Result<Self, Error>> + 'a>, BTreeMap<String, Vec<String>>), Error> where R: Read + 'a { ... } fn from_armor_many_buf<'a, R>( input: R, ) -> Result<(Box<dyn Iterator<Item = Result<Self, Error>> + 'a>, BTreeMap<String, Vec<String>>), Error> where R: BufRead + 'a { ... } fn from_armor_many_buf_with_options<'a, R>( input: R, opt: DearmorOptions, ) -> Result<(Box<dyn Iterator<Item = Result<Self, Error>> + 'a>, BTreeMap<String, Vec<String>>), Error> where R: BufRead + 'a { ... } fn from_bytes_many<'a, R>( bytes: R, ) -> Result<Box<dyn Iterator<Item = Result<Self, Error>> + 'a>, Error> where R: BufRead + 'a { ... } fn from_file<P>(path: P) -> Result<Self, Error> where P: AsRef<Path> { ... } fn from_armor_file<P>( path: P, ) -> Result<(Self, BTreeMap<String, Vec<String>>), Error> where P: AsRef<Path> { ... } fn from_armor_file_many<P>( path: P, ) -> Result<(Box<dyn Iterator<Item = Result<Self, Error>>>, BTreeMap<String, Vec<String>>), Error> where P: AsRef<Path> { ... } fn from_file_many<P>( path: P, ) -> Result<Box<dyn Iterator<Item = Result<Self, Error>>>, Error> where P: AsRef<Path> { ... } fn from_reader_single<'a, R>( input: R, ) -> Result<(Self, Option<BTreeMap<String, Vec<String>>>), Error> where R: Read + 'a { ... } fn from_reader_single_buf<'a, R>( input: R, ) -> Result<(Self, Option<BTreeMap<String, Vec<String>>>), Error> where R: BufRead + 'a { ... } fn from_reader_many<'a, R>( input: R, ) -> Result<(Box<dyn Iterator<Item = Result<Self, Error>> + 'a>, Option<BTreeMap<String, Vec<String>>>), Error> where R: Read + 'a { ... } fn from_reader_many_buf<'a, R>( input: R, ) -> Result<(Box<dyn Iterator<Item = Result<Self, Error>> + 'a>, Option<BTreeMap<String, Vec<String>>>), Error> where R: BufRead + 'a { ... }
}

Required Methods§

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

Turn a list of packets into a usable representation.

fn matches_block_type(typ: BlockType) -> bool

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

Provided Methods§

fn from_bytes<R>(bytes: R) -> Result<Self, Error>
where R: BufRead,

Parse a single byte encoded composition.

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

Parse a single armor encoded composition.

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

Parse an armor encoded list of compositions.

fn from_armor_single<R>( input: R, ) -> Result<(Self, BTreeMap<String, Vec<String>>), Error>
where R: Read,

Armored ascii data.

fn from_armor_single_buf<R>( input: R, ) -> Result<(Self, BTreeMap<String, Vec<String>>), Error>
where R: BufRead,

Armored ascii data.

fn from_armor_single_buf_with_options<R>( input: R, opt: DearmorOptions, ) -> Result<(Self, BTreeMap<String, Vec<String>>), Error>
where R: BufRead,

Armored ascii data, with explicit options for dearmoring.

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

Armored ascii data.

fn from_armor_many_buf<'a, R>( input: R, ) -> Result<(Box<dyn Iterator<Item = Result<Self, Error>> + 'a>, BTreeMap<String, Vec<String>>), Error>
where R: BufRead + 'a,

Armored ascii data.

fn from_armor_many_buf_with_options<'a, R>( input: R, opt: DearmorOptions, ) -> Result<(Box<dyn Iterator<Item = Result<Self, Error>> + 'a>, BTreeMap<String, Vec<String>>), Error>
where R: BufRead + 'a,

Armored ascii data, with explicit options for dearmoring.

fn from_bytes_many<'a, R>( bytes: R, ) -> Result<Box<dyn Iterator<Item = Result<Self, Error>> + 'a>, Error>
where R: BufRead + 'a,

Parse a list of compositions in raw byte format.

fn from_file<P>(path: P) -> Result<Self, Error>
where P: AsRef<Path>,

Parse a single binary encoded composition.

fn from_armor_file<P>( path: P, ) -> Result<(Self, BTreeMap<String, Vec<String>>), Error>
where P: AsRef<Path>,

Parse a single armor encoded composition.

fn from_armor_file_many<P>( path: P, ) -> Result<(Box<dyn Iterator<Item = Result<Self, Error>>>, BTreeMap<String, Vec<String>>), Error>
where P: AsRef<Path>,

Parse a single armor encoded composition.

fn from_file_many<P>( path: P, ) -> Result<Box<dyn Iterator<Item = Result<Self, Error>>>, Error>
where P: AsRef<Path>,

Ready binary packets from the given file.

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

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)

fn from_reader_single_buf<'a, R>( input: R, ) -> Result<(Self, Option<BTreeMap<String, Vec<String>>>), Error>
where R: BufRead + 'a,

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

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)

fn from_reader_many_buf<'a, R>( input: R, ) -> Result<(Box<dyn Iterator<Item = Result<Self, Error>> + 'a>, Option<BTreeMap<String, Vec<String>>>), Error>
where R: BufRead + 'a,

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".

Implementors§

§

impl Deserializable for DetachedSignature

§

impl Deserializable for SignedPublicKey

§

impl Deserializable for SignedSecretKey