Trait Parse

Source
pub trait Parse<'a, T> {
    // Required method
    fn from_reader<R: 'a + Read + Send + Sync>(reader: R) -> Result<T>;

    // Provided methods
    fn from_buffered_reader<R>(reader: R) -> Result<T>
       where R: BufferedReader<Cookie> + 'a { ... }
    fn from_file<P: AsRef<Path>>(path: P) -> Result<T> { ... }
    fn from_bytes<D: AsRef<[u8]> + ?Sized + Send + Sync>(
        data: &'a D,
    ) -> Result<T> { ... }
}
Expand description

Parsing of packets and related structures.

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

Required Methods§

Source

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

Reads from the given reader.

Provided Methods§

Source

fn from_buffered_reader<R>(reader: R) -> Result<T>
where R: BufferedReader<Cookie> + 'a,

Reads from the given buffered reader.

Source

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.

Source

fn from_bytes<D: AsRef<[u8]> + ?Sized + Send + Sync>(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.

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§

Source§

impl<'a> Parse<'a, S2K> for S2K

Source§

impl<'a> Parse<'a, Packet> for Packet

Source§

impl<'a> Parse<'a, AED> for AED

Source§

impl<'a> Parse<'a, Key<UnspecifiedParts, UnspecifiedRole>> for Key<UnspecifiedParts, UnspecifiedRole>

Source§

impl<'a> Parse<'a, OnePassSig> for OnePassSig

Source§

impl<'a> Parse<'a, PKESK> for PKESK

Source§

impl<'a> Parse<'a, SEIP> for SEIP

Source§

impl<'a> Parse<'a, SKESK> for SKESK

Source§

impl<'a> Parse<'a, Signature> for Signature

Source§

impl<'a> Parse<'a, PacketParserResult<'a>> for PacketParser<'a>

Source§

impl<'a> Parse<'a, RawCert<'a>> for RawCert<'a>

Source§

impl<'a> Parse<'a, RawCertParser<'a>> for RawCertParser<'a>

Source§

impl<'a> Parse<'a, CertParser<'a>> for CertParser<'a>

Source§

impl<'a> Parse<'a, MPI> for MPI

Source§

impl<'a> Parse<'a, Header> for Header

Source§

impl<'a> Parse<'a, OnePassSig3> for OnePassSig3

Source§

impl<'a> Parse<'a, PKESK3> for PKESK3

Source§

impl<'a> Parse<'a, CompressedData> for CompressedData

Source§

impl<'a> Parse<'a, Literal> for Literal

Source§

impl<'a> Parse<'a, MDC> for MDC

Source§

impl<'a> Parse<'a, Marker> for Marker

Source§

impl<'a> Parse<'a, Trust> for Trust

Source§

impl<'a> Parse<'a, UserID> for UserID

Source§

impl<'a> Parse<'a, UserAttribute> for UserAttribute

Source§

impl<'a> Parse<'a, Cert> for Cert

Source§

impl<'a> Parse<'a, Message> for Message

Source§

impl<'a> Parse<'a, PacketPile> for PacketPile

Source§

impl<'a> Parse<'a, DecryptorBuilder<'a>> for DecryptorBuilder<'a>

Source§

impl<'a> Parse<'a, DetachedVerifierBuilder<'a>> for DetachedVerifierBuilder<'a>

Source§

impl<'a> Parse<'a, VerifierBuilder<'a>> for VerifierBuilder<'a>

Source§

impl<'a> Parse<'a, PacketParserBuilder<'a>> for PacketParserBuilder<'a>

Source§

impl<'a> Parse<'a, PacketPileParser<'a>> for PacketPileParser<'a>