pub type BitString = BitVec<u8, Msb0>;Expand description
The BIT STRING type.
/// ## Usage
ASN1 declaration such as …
Test-type-a ::= BIT STRING… can be represented using rasn as …
use rasn::prelude::*;
#[derive(AsnType, Decode, Encode)]
#[rasn(delegate)]
struct TestTypeA(pub BitString);Aliased Type§
pub struct BitString { /* private fields */ }Trait Implementations§
Source§impl AsnType for BitString
impl AsnType for BitString
Source§const IDENTIFIER: Identifier = Identifier::BIT_STRING
const IDENTIFIER: Identifier = Identifier::BIT_STRING
Identifier of an ASN.1 type as specified in the original specification
if not identical with the identifier of
SelfSource§const TAG_TREE: TagTree = _
const TAG_TREE: TagTree = _
The root of this type’s tree of tag’s if it a CHOICE type, otherwise its
Leaf that points Self::TAG.Source§const CONSTRAINTS: Constraints = Constraints::NONE
const CONSTRAINTS: Constraints = Constraints::NONE
The set of constraints for values of the given type.
Source§const IS_CHOICE: bool = false
const IS_CHOICE: bool = false
Whether the type is choice type. PER/OER encoding rules require this knowledge.
Source§fn is_present(&self) -> bool
fn is_present(&self) -> bool
Source§impl Decode for BitString
impl Decode for BitString
Source§fn decode_with_tag_and_constraints<D: Decoder>(
decoder: &mut D,
tag: Tag,
constraints: Constraints,
) -> Result<Self, D::Error>
fn decode_with_tag_and_constraints<D: Decoder>( decoder: &mut D, tag: Tag, constraints: Constraints, ) -> Result<Self, D::Error>
Decode this value implicitly tagged with
tag from a given ASN.1
decoder with a set of constraints on what values of that type are allowed. Read moreSource§fn decode<D: Decoder>(decoder: &mut D) -> Result<Self, D::Error>
fn decode<D: Decoder>(decoder: &mut D) -> Result<Self, D::Error>
Decode this value from a given ASN.1 decoder. Read more
Source§fn decode_with_tag<D: Decoder>(
decoder: &mut D,
tag: Tag,
) -> Result<Self, D::Error>
fn decode_with_tag<D: Decoder>( decoder: &mut D, tag: Tag, ) -> Result<Self, D::Error>
Decode this value implicitly tagged with
tag from a given ASN.1 decoder. Read moreSource§fn decode_with_constraints<D: Decoder>(
decoder: &mut D,
constraints: Constraints,
) -> Result<Self, D::Error>
fn decode_with_constraints<D: Decoder>( decoder: &mut D, constraints: Constraints, ) -> Result<Self, D::Error>
Decode this value from a given ASN.1 decoder with a set of constraints
on what values of that type are allowed. Read more
Source§impl Encode for BitString
impl Encode for BitString
Source§fn encode_with_tag_and_constraints<'b, E: Encoder<'b>>(
&self,
encoder: &mut E,
tag: Tag,
constraints: Constraints,
identifier: Identifier,
) -> Result<(), E::Error>
fn encode_with_tag_and_constraints<'b, E: Encoder<'b>>( &self, encoder: &mut E, tag: Tag, constraints: Constraints, identifier: Identifier, ) -> Result<(), E::Error>
Encode this value with
tag into the given crate::Encoder with the
constraints the values this is allowed to encode into. Read moreSource§fn encode_with_tag<'b, E: Encoder<'b>>(
&self,
encoder: &mut E,
tag: Tag,
) -> Result<(), E::Error>
fn encode_with_tag<'b, E: Encoder<'b>>( &self, encoder: &mut E, tag: Tag, ) -> Result<(), E::Error>
Source§fn encode_with_identifier<'b, E: Encoder<'b>>(
&self,
encoder: &mut E,
identifier: Identifier,
) -> Result<(), E::Error>
fn encode_with_identifier<'b, E: Encoder<'b>>( &self, encoder: &mut E, identifier: Identifier, ) -> Result<(), E::Error>
Source§fn encode_with_tag_and_identifier<'b, E: Encoder<'b>>(
&self,
encoder: &mut E,
tag: Tag,
identifier: Identifier,
) -> Result<(), E::Error>
fn encode_with_tag_and_identifier<'b, E: Encoder<'b>>( &self, encoder: &mut E, tag: Tag, identifier: Identifier, ) -> Result<(), E::Error>
Source§fn encode_with_constraints<'b, E: Encoder<'b>>(
&self,
encoder: &mut E,
constraints: Constraints,
) -> Result<(), E::Error>
fn encode_with_constraints<'b, E: Encoder<'b>>( &self, encoder: &mut E, constraints: Constraints, ) -> Result<(), E::Error>
Encode this value into the given
crate::Encoder with the
constraints the values this is allowed to encode into. Read moreSource§fn encode_with_constraints_and_identifier<'b, E: Encoder<'b>>(
&self,
encoder: &mut E,
constraints: Constraints,
identifier: Identifier,
) -> Result<(), E::Error>
fn encode_with_constraints_and_identifier<'b, E: Encoder<'b>>( &self, encoder: &mut E, constraints: Constraints, identifier: Identifier, ) -> Result<(), E::Error>
Encode this value into the given
crate::Encoder with identifier and the
constraints the values this is allowed to encode into. Read more