der

Trait 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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so 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,