Trait der::EncodeValue

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

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, writer: &mut impl Writer) -> Result<()>

source§

impl EncodeValue for i8

source§

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

source§

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

source§

impl EncodeValue for i16

source§

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

source§

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

source§

impl EncodeValue for i32

source§

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

source§

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

source§

impl EncodeValue for i64

source§

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

source§

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

source§

impl EncodeValue for i128

source§

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

source§

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

source§

impl EncodeValue for str

source§

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

source§

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

source§

impl EncodeValue for u8

source§

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

source§

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

source§

impl EncodeValue for u16

source§

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

source§

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

source§

impl EncodeValue for u32

source§

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

source§

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

source§

impl EncodeValue for u64

source§

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

source§

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

source§

impl EncodeValue for u128

source§

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

source§

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

source§

impl EncodeValue for ()

source§

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

source§

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

source§

impl EncodeValue for String

source§

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

source§

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

source§

impl EncodeValue for SystemTime

source§

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

source§

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

source§

impl<T> EncodeValue for Box<T>
where T: EncodeValue,

source§

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

source§

fn encode_value(&self, writer: &mut impl 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 impl 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 impl Writer) -> Result<()>

Implementors§

source§

impl EncodeValue for Any

source§

impl EncodeValue for AnyRef<'_>

source§

impl EncodeValue for BitString

source§

impl EncodeValue for BitStringRef<'_>

source§

impl EncodeValue for BmpString

source§

impl EncodeValue for GeneralizedTime

source§

impl EncodeValue for Ia5String

source§

impl EncodeValue for Int

source§

impl EncodeValue for Null

source§

impl EncodeValue for ObjectIdentifier

source§

impl EncodeValue for OctetString

source§

impl EncodeValue for OctetStringRef<'_>

source§

impl EncodeValue for PrintableString

source§

impl EncodeValue for SequenceRef<'_>

source§

impl EncodeValue for TeletexString

source§

impl EncodeValue for Uint

source§

impl EncodeValue for UtcTime

source§

impl EncodeValue for DateTime

source§

impl<'a> EncodeValue for Ia5StringRef<'a>

source§

impl<'a> EncodeValue for IntRef<'a>

source§

impl<'a> EncodeValue for PrintableStringRef<'a>

source§

impl<'a> EncodeValue for TeletexStringRef<'a>

source§

impl<'a> EncodeValue for UintRef<'a>

source§

impl<'a> EncodeValue for Utf8StringRef<'a>

source§

impl<'a> EncodeValue for VideotexStringRef<'a>

source§

impl<'a, T> EncodeValue for ContextSpecificRef<'a, T>
where T: EncodeValue + Tagged,

source§

impl<'a, T> EncodeValue for SetOfVec<T>
where T: 'a + Decode<'a> + Encode + DerOrd,

source§

impl<'a, T> EncodeValue for EncodeValueRef<'a, T>
where T: EncodeValue,

source§

impl<'a, T, const N: usize> EncodeValue for SetOf<T, N>
where T: 'a + Decode<'a> + Encode + DerOrd,

source§

impl<T> EncodeValue for ContextSpecific<T>
where T: EncodeValue + Tagged,

source§

impl<T, const N: usize> EncodeValue for SequenceOf<T, N>
where T: Encode,