Trait sequoia_openpgp::parse::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§
Provided Methods§
sourcefn from_buffered_reader<R>(reader: R) -> Result<T>where
R: BufferedReader<Cookie> + 'a,
fn from_buffered_reader<R>(reader: R) -> Result<T>where
R: BufferedReader<Cookie> + 'a,
Reads from the given buffered reader.
sourcefn from_file<P: AsRef<Path>>(path: P) -> Result<T>
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.
sourcefn from_bytes<D: AsRef<[u8]> + ?Sized + Send + Sync>(data: &'a D) -> Result<T>
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.
Object Safety§
This trait is not object safe.