[−][src]Struct red_asn1::Tag
Class to represent DER-ASN1 tags of the different types.
Each tag is divided into 3 parts:
- Class: If tag is of an Primitive or Constructed object
- Type: The scope of the object
- Number: A distinguished number between objects of the same type and class
Fields
number: u8
type: TagType
class: TagClass
Implementations
impl Tag
[src]
pub fn new(number: u8, r#type: TagType, class: TagClass) -> Tag
[src]
Creates a new tag from a given number, type and class
pub fn new_primitive_universal(number: u8) -> Tag
[src]
Shorcut of: Tag::new(tag_number, TagType::Primitive, TagClass::Universal)
pub fn new_constructed_universal(number: u8) -> Tag
[src]
Shorcut of: Tag::new(tag_number, TagType::Constructed, TagClass::Universal)
pub fn build(&self) -> Vec<u8>
[src]
Produces an DER version of the tag in bytes
pub fn parse(raw: &[u8]) -> Result<(&[u8], Self)>
[src]
Set the Tag values from a array of bytes
Trait Implementations
impl Clone for Tag
[src]
impl Copy for Tag
[src]
impl Debug for Tag
[src]
impl Default for Tag
[src]
impl PartialEq<Tag> for Tag
[src]
impl StructuralPartialEq for Tag
[src]
Auto Trait Implementations
impl RefUnwindSafe for Tag
impl Send for Tag
impl Sync for Tag
impl Unpin for Tag
impl UnwindSafe for Tag
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,