Skip to main content

DecodePem

Trait DecodePem 

Source
pub trait DecodePem: DecodeOwned + PemLabel {
    // Required method
    fn from_pem(
        pem: impl AsRef<[u8]>,
    ) -> Result<Self, <Self as Decode<'static>>::Error>;
}
Expand description

PEM decoding trait.

This trait is automatically impl’d for any type which impls both DecodeOwned and PemLabel.

Required Methods§

Source

fn from_pem( pem: impl AsRef<[u8]>, ) -> Result<Self, <Self as Decode<'static>>::Error>

Try to decode this type from PEM.

§Errors

If a PEM or DER decoding error occurred.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T: DecodeOwned<Error = Error> + PemLabel> DecodePem for T

Available on crate feature pem only.