Trait der::EncodeValue

source ·
pub trait EncodeValue {
    // Required methods
    fn value_len(&self) -> Result<Length>;
    fn encode_value(&self, encoder: &mut Encoder<'_>) -> Result<()>;

    // Provided method
    fn header(&self) -> Result<Header>
       where Self: Tagged { ... }
}
Expand description

Encode the value part of a Tag-Length-Value encoded field, sans the Tag and Length.

Required Methods§

source

fn value_len(&self) -> Result<Length>

Compute the length of this value (sans Tag+Length header) when encoded as ASN.1 DER.

source

fn encode_value(&self, encoder: &mut Encoder<'_>) -> Result<()>

Encode value (sans Tag+Length header) as ASN.1 DER using the provided Encoder.

Provided Methods§

source

fn header(&self) -> Result<Header>
where Self: Tagged,

Get the Header used to encode this value.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl EncodeValue for bool

source§

fn value_len(&self) -> Result<Length>

source§

fn encode_value(&self, encoder: &mut Encoder<'_>) -> Result<()>

source§

impl EncodeValue for i8

source§

fn value_len(&self) -> Result<Length>

source§

fn encode_value(&self, encoder: &mut Encoder<'_>) -> Result<()>

source§

impl EncodeValue for i16

source§

fn value_len(&self) -> Result<Length>

source§

fn encode_value(&self, encoder: &mut Encoder<'_>) -> Result<()>

source§

impl EncodeValue for i32

source§

fn value_len(&self) -> Result<Length>

source§

fn encode_value(&self, encoder: &mut Encoder<'_>) -> Result<()>

source§

impl EncodeValue for i64

source§

fn value_len(&self) -> Result<Length>

source§

fn encode_value(&self, encoder: &mut Encoder<'_>) -> Result<()>

source§

impl EncodeValue for i128

source§

fn value_len(&self) -> Result<Length>

source§

fn encode_value(&self, encoder: &mut Encoder<'_>) -> Result<()>

source§

impl EncodeValue for str

source§

fn value_len(&self) -> Result<Length>

source§

fn encode_value(&self, encoder: &mut Encoder<'_>) -> Result<()>

source§

impl EncodeValue for u8

source§

fn value_len(&self) -> Result<Length>

source§

fn encode_value(&self, encoder: &mut Encoder<'_>) -> Result<()>

source§

impl EncodeValue for u16

source§

fn value_len(&self) -> Result<Length>

source§

fn encode_value(&self, encoder: &mut Encoder<'_>) -> Result<()>

source§

impl EncodeValue for u32

source§

fn value_len(&self) -> Result<Length>

source§

fn encode_value(&self, encoder: &mut Encoder<'_>) -> Result<()>

source§

impl EncodeValue for u64

source§

fn value_len(&self) -> Result<Length>

source§

fn encode_value(&self, encoder: &mut Encoder<'_>) -> Result<()>

source§

impl EncodeValue for u128

source§

fn value_len(&self) -> Result<Length>

source§

fn encode_value(&self, encoder: &mut Encoder<'_>) -> Result<()>

source§

impl<T, const N: usize> EncodeValue for [T; N]
where T: Encodable,

source§

fn value_len(&self) -> Result<Length>

source§

fn encode_value(&self, encoder: &mut Encoder<'_>) -> Result<()>

Implementors§