Trait der::EncodeValue

source ·
pub trait EncodeValue {
    // Required methods
    fn value_len(&self) -> Result<Length>;
    fn encode_value(&self, encoder: &mut dyn Writer) -> 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 dyn Writer) -> Result<()>

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

Provided Methods§

source

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

Get the Header used to encode this value.

Implementations on Foreign Types§

source§

impl EncodeValue for str

source§

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

source§

fn encode_value(&self, writer: &mut dyn Writer) -> Result<()>

source§

impl EncodeValue for i16

source§

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

source§

fn encode_value(&self, writer: &mut dyn Writer) -> Result<()>

source§

impl EncodeValue for bool

source§

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

source§

fn encode_value(&self, writer: &mut dyn Writer) -> Result<()>

source§

impl EncodeValue for ()

source§

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

source§

fn encode_value(&self, _writer: &mut dyn Writer) -> Result<()>

source§

impl EncodeValue for u8

source§

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

source§

fn encode_value(&self, writer: &mut dyn Writer) -> Result<()>

source§

impl EncodeValue for u16

source§

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

source§

fn encode_value(&self, writer: &mut dyn Writer) -> Result<()>

source§

impl EncodeValue for u32

source§

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

source§

fn encode_value(&self, writer: &mut dyn Writer) -> Result<()>

source§

impl EncodeValue for i8

source§

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

source§

fn encode_value(&self, writer: &mut dyn Writer) -> Result<()>

source§

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

source§

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

source§

fn encode_value(&self, writer: &mut dyn Writer) -> Result<()>

source§

impl EncodeValue for SystemTime

source§

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

source§

fn encode_value(&self, writer: &mut dyn Writer) -> Result<()>

source§

impl EncodeValue for i128

source§

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

source§

fn encode_value(&self, writer: &mut dyn Writer) -> Result<()>

source§

impl EncodeValue for u128

source§

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

source§

fn encode_value(&self, writer: &mut dyn Writer) -> Result<()>

source§

impl EncodeValue for String

source§

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

source§

fn encode_value(&self, writer: &mut dyn Writer) -> Result<()>

source§

impl EncodeValue for i32

source§

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

source§

fn encode_value(&self, writer: &mut dyn Writer) -> Result<()>

source§

impl<T> EncodeValue for Vec<T>where T: Encode,

source§

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

source§

fn encode_value(&self, writer: &mut dyn Writer) -> Result<()>

source§

impl EncodeValue for i64

source§

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

source§

fn encode_value(&self, writer: &mut dyn Writer) -> Result<()>

source§

impl EncodeValue for u64

source§

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

source§

fn encode_value(&self, writer: &mut dyn Writer) -> Result<()>

Implementors§