[][src]Trait sequoia_openpgp::parse::Parse

pub trait Parse<'a, T> {
    fn from_reader<R: 'a + Read>(reader: R) -> Result<T>;

    fn from_file<P: AsRef<Path>>(path: P) -> Result<T> { ... }
fn from_bytes<D: AsRef<[u8]> + ?Sized>(data: &'a D) -> Result<T> { ... } }

Parsing of packets and related structures.

This is a uniform interface to parse packets, messages, keys, and related data structures.

Required methods

fn from_reader<R: 'a + Read>(reader: R) -> Result<T>

Reads from the given reader.

Loading content...

Provided methods

fn from_file<P: AsRef<Path>>(path: P) -> Result<T>

Reads from the given file.

The default implementation just uses from_reader(..), but implementations can provide their own specialized version.

fn from_bytes<D: AsRef<[u8]> + ?Sized>(data: &'a D) -> Result<T>

Reads from the given slice.

The default implementation just uses from_reader(..), but implementations can provide their own specialized version.

Loading content...

Implementors

impl<'a> Parse<'a, S2K> for S2K[src]

fn from_reader<R: 'a + Read>(reader: R) -> Result<Self>[src]

Reads an S2K from reader.

fn from_file<P: AsRef<Path>>(path: P) -> Result<T>[src]

fn from_bytes<D: AsRef<[u8]> + ?Sized>(data: &'a D) -> Result<T>[src]

impl<'a> Parse<'a, Sexp> for Sexp[src]

impl<'a> Parse<'a, Packet> for Packet[src]

fn from_file<P: AsRef<Path>>(path: P) -> Result<T>[src]

fn from_bytes<D: AsRef<[u8]> + ?Sized>(data: &'a D) -> Result<T>[src]

impl<'a> Parse<'a, AED> for AED[src]

fn from_file<P: AsRef<Path>>(path: P) -> Result<T>[src]

fn from_bytes<D: AsRef<[u8]> + ?Sized>(data: &'a D) -> Result<T>[src]

impl<'a> Parse<'a, Key<UnspecifiedParts, UnspecifiedRole>> for UnspecifiedKey[src]

fn from_file<P: AsRef<Path>>(path: P) -> Result<T>[src]

fn from_bytes<D: AsRef<[u8]> + ?Sized>(data: &'a D) -> Result<T>[src]

impl<'a> Parse<'a, OnePassSig> for OnePassSig[src]

fn from_file<P: AsRef<Path>>(path: P) -> Result<T>[src]

fn from_bytes<D: AsRef<[u8]> + ?Sized>(data: &'a D) -> Result<T>[src]

impl<'a> Parse<'a, PKESK> for PKESK[src]

fn from_file<P: AsRef<Path>>(path: P) -> Result<T>[src]

fn from_bytes<D: AsRef<[u8]> + ?Sized>(data: &'a D) -> Result<T>[src]

impl<'a> Parse<'a, SEIP> for SEIP[src]

fn from_file<P: AsRef<Path>>(path: P) -> Result<T>[src]

fn from_bytes<D: AsRef<[u8]> + ?Sized>(data: &'a D) -> Result<T>[src]

impl<'a> Parse<'a, SKESK> for SKESK[src]

fn from_file<P: AsRef<Path>>(path: P) -> Result<T>[src]

fn from_bytes<D: AsRef<[u8]> + ?Sized>(data: &'a D) -> Result<T>[src]

impl<'a> Parse<'a, Signature> for Signature[src]

fn from_file<P: AsRef<Path>>(path: P) -> Result<T>[src]

fn from_bytes<D: AsRef<[u8]> + ?Sized>(data: &'a D) -> Result<T>[src]

impl<'a> Parse<'a, PacketParserResult<'a>> for PacketParser<'a>[src]

fn from_reader<R: Read + 'a>(reader: R) -> Result<PacketParserResult<'a>>[src]

Starts parsing an OpenPGP message stored in a std::io::Read object.

This function returns a PacketParser for the first packet in the stream.

fn from_file<P: AsRef<Path>>(path: P) -> Result<PacketParserResult<'a>>[src]

Starts parsing an OpenPGP message stored in a file named path.

This function returns a PacketParser for the first packet in the stream.

fn from_bytes<D: AsRef<[u8]> + ?Sized>(
    data: &'a D
) -> Result<PacketParserResult<'a>>
[src]

Starts parsing an OpenPGP message stored in a buffer.

This function returns a PacketParser for the first packet in the stream.

impl<'a> Parse<'a, MPI> for MPI[src]

fn from_file<P: AsRef<Path>>(path: P) -> Result<T>[src]

fn from_bytes<D: AsRef<[u8]> + ?Sized>(data: &'a D) -> Result<T>[src]

impl<'a> Parse<'a, Header> for Header[src]

fn from_reader<R: 'a + Read>(reader: R) -> Result<Self>[src]

Parses an OpenPGP packet's header as described in Section 4.2 of RFC 4880.

fn from_file<P: AsRef<Path>>(path: P) -> Result<T>[src]

fn from_bytes<D: AsRef<[u8]> + ?Sized>(data: &'a D) -> Result<T>[src]

impl<'a> Parse<'a, OnePassSig3> for OnePassSig3[src]

fn from_file<P: AsRef<Path>>(path: P) -> Result<T>[src]

fn from_bytes<D: AsRef<[u8]> + ?Sized>(data: &'a D) -> Result<T>[src]

impl<'a> Parse<'a, PKESK3> for PKESK3[src]

fn from_file<P: AsRef<Path>>(path: P) -> Result<T>[src]

fn from_bytes<D: AsRef<[u8]> + ?Sized>(data: &'a D) -> Result<T>[src]

impl<'a> Parse<'a, CompressedData> for CompressedData[src]

fn from_file<P: AsRef<Path>>(path: P) -> Result<T>[src]

fn from_bytes<D: AsRef<[u8]> + ?Sized>(data: &'a D) -> Result<T>[src]

impl<'a> Parse<'a, Literal> for Literal[src]

fn from_file<P: AsRef<Path>>(path: P) -> Result<T>[src]

fn from_bytes<D: AsRef<[u8]> + ?Sized>(data: &'a D) -> Result<T>[src]

impl<'a> Parse<'a, MDC> for MDC[src]

fn from_file<P: AsRef<Path>>(path: P) -> Result<T>[src]

fn from_bytes<D: AsRef<[u8]> + ?Sized>(data: &'a D) -> Result<T>[src]

impl<'a> Parse<'a, Marker> for Marker[src]

fn from_file<P: AsRef<Path>>(path: P) -> Result<T>[src]

fn from_bytes<D: AsRef<[u8]> + ?Sized>(data: &'a D) -> Result<T>[src]

impl<'a> Parse<'a, Trust> for Trust[src]

fn from_file<P: AsRef<Path>>(path: P) -> Result<T>[src]

fn from_bytes<D: AsRef<[u8]> + ?Sized>(data: &'a D) -> Result<T>[src]

impl<'a> Parse<'a, UserID> for UserID[src]

fn from_file<P: AsRef<Path>>(path: P) -> Result<T>[src]

fn from_bytes<D: AsRef<[u8]> + ?Sized>(data: &'a D) -> Result<T>[src]

impl<'a> Parse<'a, UserAttribute> for UserAttribute[src]

fn from_file<P: AsRef<Path>>(path: P) -> Result<T>[src]

fn from_bytes<D: AsRef<[u8]> + ?Sized>(data: &'a D) -> Result<T>[src]

impl<'a> Parse<'a, PacketParserBuilder<'a>> for PacketParserBuilder<'a>[src]

fn from_reader<R: Read + 'a>(reader: R) -> Result<Self>[src]

Creates a PacketParserBuilder for an OpenPGP message stored in a std::io::Read object.

fn from_file<P: AsRef<Path>>(path: P) -> Result<Self>[src]

Creates a PacketParserBuilder for an OpenPGP message stored in the file named path.

fn from_bytes<D: AsRef<[u8]> + ?Sized>(
    data: &'a D
) -> Result<PacketParserBuilder<'a>>
[src]

Creates a PacketParserBuilder for an OpenPGP message stored in the specified buffer.

impl<'a> Parse<'a, PacketPileParser<'a>> for PacketPileParser<'a>[src]

fn from_reader<R: Read + 'a>(reader: R) -> Result<PacketPileParser<'a>>[src]

Creates a PacketPileParser to parse the OpenPGP message stored in the io::Read object.

fn from_file<P: AsRef<Path>>(path: P) -> Result<PacketPileParser<'a>>[src]

Creates a PacketPileParser to parse the OpenPGP message stored in the file named by path.

fn from_bytes<D: AsRef<[u8]> + ?Sized>(
    data: &'a D
) -> Result<PacketPileParser<'a>>
[src]

Creates a PacketPileParser to parse the OpenPGP message stored in the provided buffer.

impl<'a> Parse<'a, Message> for Message[src]

fn from_reader<R: 'a + Read>(reader: R) -> Result<Self>[src]

Reads a Message from the specified reader.

See Message::from_packet_pile for more details.

fn from_file<P: AsRef<Path>>(path: P) -> Result<Self>[src]

Reads a Message from the specified file.

See Message::from_packet_pile for more details.

fn from_bytes<D: AsRef<[u8]> + ?Sized>(data: &'a D) -> Result<Self>[src]

Reads a Message from buf.

See Message::from_packet_pile for more details.

impl<'a> Parse<'a, PacketPile> for PacketPile[src]

fn from_reader<R: 'a + Read>(reader: R) -> Result<PacketPile>[src]

Deserializes the OpenPGP message stored in a std::io::Read object.

Although this method is easier to use to parse a sequence of OpenPGP packets than a PacketParser or a PacketPileParser, this interface buffers the whole message in memory. Thus, the caller must be certain that the deserialized message is not too large.

Note: this interface does buffer the contents of packets.

fn from_file<P: AsRef<Path>>(path: P) -> Result<PacketPile>[src]

Deserializes the OpenPGP message stored in the file named by path.

See from_reader for more details and caveats.

fn from_bytes<D: AsRef<[u8]> + ?Sized>(data: &'a D) -> Result<PacketPile>[src]

Deserializes the OpenPGP message stored in the provided buffer.

See from_reader for more details and caveats.

impl<'a> Parse<'a, TPK> for TPK[src]

fn from_reader<R: Read>(reader: R) -> Result<Self>[src]

Returns the first TPK encountered in the reader.

fn from_file<P: AsRef<Path>>(path: P) -> Result<Self>[src]

Returns the first TPK encountered in the file.

fn from_bytes<D: AsRef<[u8]> + ?Sized>(data: &'a D) -> Result<Self>[src]

Returns the first TPK found in buf.

buf must be an OpenPGP-encoded message.

impl<'a> Parse<'a, TPKParser<'a, IntoIter<Packet>>> for TPKParser<'a, IntoIter<Packet>>[src]

fn from_reader<R: 'a + Read>(reader: R) -> Result<Self>[src]

Initializes a TPKParser from a Reader.

fn from_file<P: AsRef<Path>>(path: P) -> Result<Self>[src]

Initializes a TPKParser from a File.

fn from_bytes<D: AsRef<[u8]> + ?Sized>(data: &'a D) -> Result<Self>[src]

Initializes a TPKParser from a byte string.

Loading content...