Trait sequoia_openpgp::parse::Parse [−][src]
pub trait Parse<'a, T> { fn from_reader<R: 'a + Read + Send + Sync>(reader: R) -> Result<T>; fn from_file<P: AsRef<Path>>(path: P) -> Result<T> { ... } fn from_bytes<D: AsRef<[u8]> + ?Sized + Send + Sync>(
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
Loading content...Provided methods
fn from_file<P: AsRef<Path>>(path: P) -> Result<T>
[src]
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 + Send + Sync>(data: &'a D) -> Result<T>
[src]
Reads from the given slice.
The default implementation just uses from_reader(..)
, but
implementations can provide their own specialized version.
Implementors
impl<'a> Parse<'a, Key<UnspecifiedParts, UnspecifiedRole>> for Key<UnspecifiedParts, UnspecifiedRole>
[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, OnePassSig> for OnePassSig
[src]impl<'a> Parse<'a, PacketParserResult<'a>> for PacketParser<'a>
[src]
impl<'a> Parse<'a, PacketParserResult<'a>> for PacketParser<'a>
[src]fn from_reader<R: Read + 'a + Send + Sync>(
reader: R
) -> Result<PacketParserResult<'a>>
[src]
fn from_reader<R: Read + 'a + Send + Sync>(
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.
impl<'a> Parse<'a, CertParser<'a>> for CertParser<'a>
[src]
impl<'a> Parse<'a, CertParser<'a>> for CertParser<'a>
[src]impl<'a> Parse<'a, Header> for Header
[src]
impl<'a> Parse<'a, Header> for Header
[src]fn from_reader<R: 'a + Read + Send + Sync>(reader: R) -> Result<Self>
[src]
fn from_reader<R: 'a + Read + Send + Sync>(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, OnePassSig3> for OnePassSig3
[src]impl<'a> Parse<'a, CompressedData> for CompressedData
[src]
impl<'a> Parse<'a, CompressedData> for CompressedData
[src]impl<'a> Parse<'a, UserAttribute> for UserAttribute
[src]
impl<'a> Parse<'a, UserAttribute> for UserAttribute
[src]impl<'a> Parse<'a, Cert> for Cert
[src]
impl<'a> Parse<'a, Cert> for Cert
[src]impl<'a> Parse<'a, Message> for Message
[src]
impl<'a> Parse<'a, Message> for Message
[src]fn from_reader<R: 'a + Read + Send + Sync>(reader: R) -> Result<Self>
[src]
fn from_reader<R: 'a + Read + Send + Sync>(reader: R) -> Result<Self>
[src]Reads a Message
from the specified reader.
See Message::try_from
for more details.
impl<'a> Parse<'a, PacketPile> for PacketPile
[src]
impl<'a> Parse<'a, PacketPile> for PacketPile
[src]fn from_reader<R: 'a + Read + Send + Sync>(reader: R) -> Result<PacketPile>
[src]
fn from_reader<R: 'a + Read + Send + Sync>(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]
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]
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, DecryptorBuilder<'a>> for DecryptorBuilder<'a>
[src]
impl<'a> Parse<'a, DecryptorBuilder<'a>> for DecryptorBuilder<'a>
[src]fn from_reader<R>(reader: R) -> Result<DecryptorBuilder<'a>> where
R: Read + 'a + Send + Sync,
[src]
R: Read + 'a + Send + Sync,
fn from_file<P>(path: P) -> Result<DecryptorBuilder<'a>> where
P: AsRef<Path>,
[src]
P: AsRef<Path>,
fn from_bytes<D: ?Sized>(data: &'a D) -> Result<DecryptorBuilder<'a>> where
D: AsRef<[u8]>,
[src]
D: AsRef<[u8]>,
impl<'a> Parse<'a, DetachedVerifierBuilder<'a>> for DetachedVerifierBuilder<'a>
[src]
impl<'a> Parse<'a, DetachedVerifierBuilder<'a>> for DetachedVerifierBuilder<'a>
[src]fn from_reader<R>(reader: R) -> Result<DetachedVerifierBuilder<'a>> where
R: Read + 'a + Send + Sync,
[src]
R: Read + 'a + Send + Sync,
fn from_file<P>(path: P) -> Result<DetachedVerifierBuilder<'a>> where
P: AsRef<Path>,
[src]
P: AsRef<Path>,
fn from_bytes<D: ?Sized>(data: &'a D) -> Result<DetachedVerifierBuilder<'a>> where
D: AsRef<[u8]>,
[src]
D: AsRef<[u8]>,
impl<'a> Parse<'a, VerifierBuilder<'a>> for VerifierBuilder<'a>
[src]
impl<'a> Parse<'a, VerifierBuilder<'a>> for VerifierBuilder<'a>
[src]fn from_reader<R>(reader: R) -> Result<VerifierBuilder<'a>> where
R: Read + 'a + Send + Sync,
[src]
R: Read + 'a + Send + Sync,
fn from_file<P>(path: P) -> Result<VerifierBuilder<'a>> where
P: AsRef<Path>,
[src]
P: AsRef<Path>,
fn from_bytes<D: ?Sized>(data: &'a D) -> Result<VerifierBuilder<'a>> where
D: AsRef<[u8]>,
[src]
D: AsRef<[u8]>,
impl<'a> Parse<'a, PacketParserBuilder<'a>> for PacketParserBuilder<'a>
[src]
impl<'a> Parse<'a, PacketParserBuilder<'a>> for PacketParserBuilder<'a>
[src]fn from_reader<R: Read + 'a + Send + Sync>(reader: R) -> Result<Self>
[src]
fn from_reader<R: Read + 'a + Send + Sync>(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]
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]
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]
impl<'a> Parse<'a, PacketPileParser<'a>> for PacketPileParser<'a>
[src]fn from_reader<R: Read + 'a + Send + Sync>(
reader: R
) -> Result<PacketPileParser<'a>>
[src]
fn from_reader<R: Read + 'a + Send + Sync>(
reader: R
) -> Result<PacketPileParser<'a>>
[src]Creates a PacketPileParser
to parse the OpenPGP message stored
in the io::Read
object.