Struct der_parser::ber::BerObjectHeader
source · pub struct BerObjectHeader<'a> {
pub class: BerClass,
pub structured: u8,
pub tag: BerTag,
pub len: u64,
pub raw_tag: Option<&'a [u8]>,
}
Fields§
§class: BerClass
§structured: u8
§tag: BerTag
§len: u64
§raw_tag: Option<&'a [u8]>
Implementations§
source§impl<'a> BerObjectHeader<'a>
impl<'a> BerObjectHeader<'a>
sourcepub fn new(class: BerClass, structured: u8, tag: BerTag, len: u64) -> Self
pub fn new(class: BerClass, structured: u8, tag: BerTag, len: u64) -> Self
Build a new BER header
sourcepub fn with_class(self, class: BerClass) -> Self
pub fn with_class(self, class: BerClass) -> Self
Update header class
sourcepub fn with_raw_tag(self, raw_tag: Option<&'a [u8]>) -> Self
pub fn with_raw_tag(self, raw_tag: Option<&'a [u8]>) -> Self
Update header to add reference to raw tag
sourcepub fn is_universal(&self) -> bool
pub fn is_universal(&self) -> bool
Test if object class is Universal
sourcepub fn is_application(&self) -> bool
pub fn is_application(&self) -> bool
Test if object class is Application
sourcepub fn is_contextspecific(&self) -> bool
pub fn is_contextspecific(&self) -> bool
Test if object class is Context-specific
sourcepub fn is_private(&self) -> bool
pub fn is_private(&self) -> bool
Test if object class is Private
sourcepub fn is_primitive(&self) -> bool
pub fn is_primitive(&self) -> bool
Test if object is primitive
sourcepub fn is_constructed(&self) -> bool
pub fn is_constructed(&self) -> bool
Test if object is constructed
Trait Implementations§
source§impl<'a> Clone for BerObjectHeader<'a>
impl<'a> Clone for BerObjectHeader<'a>
source§fn clone(&self) -> BerObjectHeader<'a>
fn clone(&self) -> BerObjectHeader<'a>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<'a> Debug for BerObjectHeader<'a>
impl<'a> Debug for BerObjectHeader<'a>
source§impl<'a> PartialEq<BerObjectHeader<'a>> for BerObjectHeader<'a>
impl<'a> PartialEq<BerObjectHeader<'a>> for BerObjectHeader<'a>
Compare two BER headers. len
fields are compared only if both objects have it set (same for raw_tag
)
source§fn eq(&self, other: &BerObjectHeader<'_>) -> bool
fn eq(&self, other: &BerObjectHeader<'_>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.