Trait rasn::Encoder [−][src]
pub trait Encoder {
type Ok;
type Error: Error;
Show 16 methods
fn encode_any(&mut self, value: &Any) -> Result<Self::Ok, Self::Error>;
fn encode_bit_string(
&mut self,
tag: Tag,
value: &BitString
) -> Result<Self::Ok, Self::Error>;
fn encode_bool(
&mut self,
tag: Tag,
value: bool
) -> Result<Self::Ok, Self::Error>;
fn encode_enumerated(
&mut self,
tag: Tag,
value: isize
) -> Result<Self::Ok, Self::Error>;
fn encode_explicit_prefix<V: Encode>(
&mut self,
tag: Tag,
value: &V
) -> Result<Self::Ok, Self::Error>;
fn encode_generalized_time(
&mut self,
tag: Tag,
value: &GeneralizedTime
) -> Result<Self::Ok, Self::Error>;
fn encode_integer(
&mut self,
tag: Tag,
value: &Integer
) -> Result<Self::Ok, Self::Error>;
fn encode_null(&mut self, tag: Tag) -> Result<Self::Ok, Self::Error>;
fn encode_object_identifier(
&mut self,
tag: Tag,
value: &[u32]
) -> Result<Self::Ok, Self::Error>;
fn encode_octet_string(
&mut self,
tag: Tag,
value: &[u8]
) -> Result<Self::Ok, Self::Error>;
fn encode_sequence<F>(
&mut self,
tag: Tag,
encoder_scope: F
) -> Result<Self::Ok, Self::Error>
where
F: FnOnce(&mut Self) -> Result<(), Self::Error>;
fn encode_sequence_of<E: Encode>(
&mut self,
tag: Tag,
value: &[E]
) -> Result<Self::Ok, Self::Error>;
fn encode_set_of<E: Encode>(
&mut self,
tag: Tag,
value: &SetOf<E>
) -> Result<Self::Ok, Self::Error>;
fn encode_utc_time(
&mut self,
tag: Tag,
value: &UtcTime
) -> Result<Self::Ok, Self::Error>;
fn encode_utf8_string(
&mut self,
tag: Tag,
value: &str
) -> Result<Self::Ok, Self::Error>;
fn encode_set<F>(
&mut self,
tag: Tag,
value: F
) -> Result<Self::Ok, Self::Error>
where
F: FnOnce(&mut Self) -> Result<(), Self::Error>;
}
Expand description
A data format encode any ASN.1 data type.
Associated Types
Required methods
Encode an unknown ASN.1 value.
Encode a BIT STRING
value.
Encode a BOOL
value.
Encode a ENUMERATED
value.
Encode a explicitly tag value.
fn encode_generalized_time(
&mut self,
tag: Tag,
value: &GeneralizedTime
) -> Result<Self::Ok, Self::Error>
fn encode_generalized_time(
&mut self,
tag: Tag,
value: &GeneralizedTime
) -> Result<Self::Ok, Self::Error>
Encode a GeneralizedTime
value.
Encode a INTEGER
value.
Encode a OBJECT IDENTIFIER
value.
Encode a OCTET STRING
value.
Encode a SEQUENCE
value.
Encode a SEQUENCE OF
value.
fn encode_set_of<E: Encode>(
&mut self,
tag: Tag,
value: &SetOf<E>
) -> Result<Self::Ok, Self::Error>
Encode a UtcTime
value.
Encode a Utf8String
value.