logo

Struct der::Encoder

source · []
pub struct Encoder<'a> { /* private fields */ }
Expand description

DER encoder.

Implementations

Create a new encoder with the given byte slice as a backing buffer.

Encode a value which impls the Encode trait.

Return an error with the given ErrorKind, annotating it with context about where the error occurred.

Return an error for an invalid value with the given tag.

Did the decoding operation fail due to an error?

Finish encoding to the buffer, returning a slice containing the data written to the buffer.

Encode a CONTEXT-SPECIFIC field with the provided tag number and mode.

Encode an ASN.1 SEQUENCE of the given length.

Spawns a nested Encoder which is expected to be exactly the specified length upon completion.

Trait Implementations

Formats the value using the given formatter. Read more

Write the given DER-encoded bytes as output.

Write a single byte.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.