[][src]Trait bcder::encode::Values

pub trait Values {
    pub fn encoded_len(&self, mode: Mode) -> usize;
pub fn write_encoded<W: Write>(
        &self,
        mode: Mode,
        target: &mut W
    ) -> Result<(), Error>; pub fn explicit(self, tag: Tag) -> Constructed<Self>
    where
        Self: Sized
, { ... }
pub fn to_captured(&self, mode: Mode) -> Captured { ... } }

A type that is a value encoder.

Value encoders know how to encode themselves into a sequence of BER encoded values. While you can impl this trait for your type manually, in practice it is often easier to define a method called encode and let it return some dedicated value encoder type constructed from the types provided by this module.

A type implementing this trait should encodes itself into one or more BER values. That is, the type becomes the content or part of the content of a constructed value.

Required methods

pub fn encoded_len(&self, mode: Mode) -> usize[src]

Returns the length of the encoded values for the given mode.

pub fn write_encoded<W: Write>(
    &self,
    mode: Mode,
    target: &mut W
) -> Result<(), Error>
[src]

Encodes the values in the given mode and writes them to target.

Loading content...

Provided methods

pub fn explicit(self, tag: Tag) -> Constructed<Self> where
    Self: Sized
[src]

Converts the encoder into one with an explicit tag.

pub fn to_captured(&self, mode: Mode) -> Captured[src]

Captures the encoded values in the given mode.

Loading content...

Implementations on Foreign Types

impl<'a, T: Values> Values for &'a T[src]

impl<T11: Values, T10: Values, T9: Values, T8: Values, T7: Values, T6: Values, T5: Values, T4: Values, T3: Values, T2: Values, T1: Values, T0: Values> Values for (T11, T10, T9, T8, T7, T6, T5, T4, T3, T2, T1, T0)[src]

impl<T10: Values, T9: Values, T8: Values, T7: Values, T6: Values, T5: Values, T4: Values, T3: Values, T2: Values, T1: Values, T0: Values> Values for (T10, T9, T8, T7, T6, T5, T4, T3, T2, T1, T0)[src]

impl<T9: Values, T8: Values, T7: Values, T6: Values, T5: Values, T4: Values, T3: Values, T2: Values, T1: Values, T0: Values> Values for (T9, T8, T7, T6, T5, T4, T3, T2, T1, T0)[src]

impl<T8: Values, T7: Values, T6: Values, T5: Values, T4: Values, T3: Values, T2: Values, T1: Values, T0: Values> Values for (T8, T7, T6, T5, T4, T3, T2, T1, T0)[src]

impl<T7: Values, T6: Values, T5: Values, T4: Values, T3: Values, T2: Values, T1: Values, T0: Values> Values for (T7, T6, T5, T4, T3, T2, T1, T0)[src]

impl<T6: Values, T5: Values, T4: Values, T3: Values, T2: Values, T1: Values, T0: Values> Values for (T6, T5, T4, T3, T2, T1, T0)[src]

impl<T5: Values, T4: Values, T3: Values, T2: Values, T1: Values, T0: Values> Values for (T5, T4, T3, T2, T1, T0)[src]

impl<T4: Values, T3: Values, T2: Values, T1: Values, T0: Values> Values for (T4, T3, T2, T1, T0)[src]

impl<T3: Values, T2: Values, T1: Values, T0: Values> Values for (T3, T2, T1, T0)[src]

impl<T2: Values, T1: Values, T0: Values> Values for (T2, T1, T0)[src]

impl<T1: Values, T0: Values> Values for (T1, T0)[src]

impl<T0: Values> Values for (T0,)[src]

impl<V: Values> Values for Option<V>[src]

Encoding of an optional value.

This implementation encodes None as nothing, i.e., as an OPTIONAL in ASN.1 parlance.

impl<V: Values> Values for [V][src]

impl<V: Values> Values for Vec<V>[src]

Loading content...

Implementors

impl Values for Captured[src]

impl Values for Nothing[src]

impl<L: Values, C: Values, R: Values> Values for Choice3<L, C, R>[src]

impl<L: Values, R: Values> Values for Choice2<L, R>[src]

impl<P: PrimitiveContent> Values for Primitive<P>[src]

impl<T> Values for Iter<T> where
    T: Clone + IntoIterator,
    <T as IntoIterator>::Item: Values
[src]

impl<T, F, U, V> Values for Slice<T, F, U, V> where
    T: AsRef<[U]>,
    F: Fn(&U) -> V,
    V: Values
[src]

impl<T: AsRef<OctetString>> Values for OctetStringEncoder<T>[src]

impl<V: Values> Values for Constructed<V>[src]

impl<V: Values> Values for WrappingOctetStringEncoder<V>[src]

Loading content...