Struct der_parser::ber::BerObjectHeader[][src]

pub struct BerObjectHeader<'a> {
    pub class: BerClass,
    pub structured: u8,
    pub tag: BerTag,
    pub len: BerSize,
    pub raw_tag: Option<&'a [u8]>,
}

BER object header (identifier and length)

Fields

class: BerClass

Object class: universal, application, context-specific, or private

structured: u8

Constructed attribute: 1 if constructed, else 0

tag: BerTag

Tag number

len: BerSize

Object length: definite or indefinite

raw_tag: Option<&'a [u8]>

Optionally, the raw encoding of the tag

This is useful in some cases, where different representations of the same BER tags have different meanings (BER only)

Implementations

impl<'a> BerObjectHeader<'a>[src]

pub fn new<Len: Into<BerSize>>(
    class: BerClass,
    structured: u8,
    tag: BerTag,
    len: Len
) -> Self
[src]

Build a new BER header

pub fn with_class(self, class: BerClass) -> Self[src]

Update header class

pub fn with_tag(self, tag: BerTag) -> Self[src]

Update header tag

pub fn with_len(self, len: BerSize) -> Self[src]

Update header length

pub fn with_raw_tag(self, raw_tag: Option<&'a [u8]>) -> Self[src]

Update header to add reference to raw tag

pub fn is_universal(&self) -> bool[src]

Test if object class is Universal

pub fn is_application(&self) -> bool[src]

Test if object class is Application

pub fn is_contextspecific(&self) -> bool[src]

Test if object class is Context-specific

pub fn is_private(&self) -> bool[src]

Test if object class is Private

pub fn is_primitive(&self) -> bool[src]

Test if object is primitive

pub fn is_constructed(&self) -> bool[src]

Test if object is constructed

Trait Implementations

impl<'a> Clone for BerObjectHeader<'a>[src]

impl<'a> Debug for BerObjectHeader<'a>[src]

impl<'a> PartialEq<BerObjectHeader<'a>> for BerObjectHeader<'a>[src]

Compare two BER headers. len fields are compared only if both objects have it set (same for raw_tag)

Auto Trait Implementations

impl<'a> RefUnwindSafe for BerObjectHeader<'a>

impl<'a> Send for BerObjectHeader<'a>

impl<'a> Sync for BerObjectHeader<'a>

impl<'a> Unpin for BerObjectHeader<'a>

impl<'a> UnwindSafe for BerObjectHeader<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Conv for T

impl<T> Conv for T

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pipe for T where
    T: ?Sized

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> TryConv for T

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.