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 f64

Available on crate feature real only.
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

Available on crate feature alloc only.
source§

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

source§

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

source§

impl EncodeValue for SystemTime

Available on crate feature std only.
source§

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

source§

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

source§

impl EncodeValue for Bytes

Available on crate feature bytes only.
source§

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

source§

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

source§

impl EncodeValue for PrimitiveDateTime

Available on crate feature time only.
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,

Available on crate feature alloc only.
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,

Available on crate feature alloc only.
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<()>

source§

impl<T: Flags> EncodeValue for FlagSet<T>
where T::Type: From<bool> + Shl<usize, Output = T::Type>, u128: From<T::Type>,

Available on crate feature flagset only.
source§

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

source§

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

Implementors§

source§

impl EncodeValue for Any

Available on crate feature alloc only.
source§

impl EncodeValue for AnyRef<'_>

source§

impl EncodeValue for BitString

Available on crate feature alloc only.
source§

impl EncodeValue for BitStringRef<'_>

source§

impl EncodeValue for BmpString

Available on crate feature alloc only.
source§

impl EncodeValue for GeneralizedTime

source§

impl EncodeValue for Ia5String

Available on crate feature alloc only.
source§

impl EncodeValue for Int

Available on crate feature alloc only.
source§

impl EncodeValue for Null

source§

impl EncodeValue for ObjectIdentifier

Available on crate feature oid only.
source§

impl EncodeValue for OctetString

Available on crate feature alloc only.
source§

impl EncodeValue for OctetStringRef<'_>

source§

impl EncodeValue for PrintableString

Available on crate feature alloc only.
source§

impl EncodeValue for SequenceRef<'_>

source§

impl EncodeValue for TeletexString

Available on crate feature alloc only.
source§

impl EncodeValue for Uint

Available on crate feature alloc only.
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,

Available on crate feature alloc only.
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,