Trait EncodePem

Source
pub trait EncodePem: Encode + PemLabel {
    // Required methods
    fn encode_pem<'o>(
        &self,
        line_ending: LineEnding,
        out: &'o mut [u8],
    ) -> Result<&'o str, Error>;
    fn encode_pem_string(
        &self,
        line_ending: LineEnding,
    ) -> Result<String, Error>;
}
Available on crate feature pem only.
Expand description

Encoding trait for PEM documents.

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

Required Methods§

Source

fn encode_pem<'o>( &self, line_ending: LineEnding, out: &'o mut [u8], ) -> Result<&'o str, Error>

Encode this type using the Encode trait, writing the resulting PEM document into the provided out buffer.

Source

fn encode_pem_string(&self, line_ending: LineEnding) -> Result<String, Error>

Available on crate feature alloc only.

Encode this type using the Encode trait, writing the resulting PEM document to a returned String.

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§