Skip to main content

DecodePem

Trait DecodePem 

Source
pub trait DecodePem:
    Decode
    + PemLabel
    + Sized {
    // Required method
    fn decode_pem(pem: impl AsRef<[u8]>) -> Result<Self, Self::Error>;
}
Available on crate feature pem only.
Expand description

Decoding trait for PEM documents.

This is an extension trait which is auto-impl’d for types which impl the Decode, PemLabel, and Sized traits.

Required Methods§

Source

fn decode_pem(pem: impl AsRef<[u8]>) -> Result<Self, Self::Error>

Decode the provided PEM-encoded string, interpreting the Base64-encoded body of the document using the Decode trait.

§Errors

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§