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.

Implementors§