[][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.

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

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

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

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

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

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

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

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

impl<'a> Parse<'a, Signature> for Signature[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, CertParser<'a, IntoIter<Packet>>> for CertParser<'a, IntoIter<Packet>>[src]

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

Initializes a CertParser from a Reader.

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

Initializes a CertParser from a File.

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

Initializes a CertParser from a byte string.

impl<'a> Parse<'a, MPI> for MPI[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.

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

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

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

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

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

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

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

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

impl<'a> Parse<'a, UserAttribute> for UserAttribute[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, Cert> for Cert[src]

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

Returns the first Cert encountered in the reader.

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

Returns the first Cert encountered in the file.

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

Returns the first Cert found in buf.

buf must be an OpenPGP-encoded message.

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::try_from for more details.

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

Reads a Message from the specified file.

See Message::try_from for more details.

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

Reads a Message from buf.

See Message::try_from 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.

Loading content...