pub struct BerReader<'a> { /* private fields */ }Expand description
A reader for BER-encoded data.
Implementations§
Source§impl<'a> BerReader<'a>
impl<'a> BerReader<'a>
Sourcepub fn read_length(&mut self) -> Result<Length>
pub fn read_length(&mut self) -> Result<Length>
Read a length.
Sourcepub fn read_bytes(&mut self, count: usize) -> Result<&'a [u8]>
pub fn read_bytes(&mut self, count: usize) -> Result<&'a [u8]>
Read raw bytes.
Sourcepub fn read_tlv(&mut self) -> Result<(Tag, &'a [u8])>
pub fn read_tlv(&mut self) -> Result<(Tag, &'a [u8])>
Read a TLV (Tag-Length-Value) and return the value bytes.
Sourcepub fn read_boolean(&mut self) -> Result<bool>
pub fn read_boolean(&mut self) -> Result<bool>
Read a boolean value.
Sourcepub fn read_integer(&mut self) -> Result<i64>
pub fn read_integer(&mut self) -> Result<i64>
Read an integer value.
Sourcepub fn read_context_integer(&mut self, expected_tag: u32) -> Result<i64>
pub fn read_context_integer(&mut self, expected_tag: u32) -> Result<i64>
Read an integer with a context tag.
Sourcepub fn read_utf8_string(&mut self) -> Result<String>
pub fn read_utf8_string(&mut self) -> Result<String>
Read a UTF-8 string.
Sourcepub fn read_octet_string(&mut self) -> Result<Vec<u8>>
pub fn read_octet_string(&mut self) -> Result<Vec<u8>>
Read an octet string.
Sourcepub fn read_sequence(&mut self) -> Result<BerReader<'a>>
pub fn read_sequence(&mut self) -> Result<BerReader<'a>>
Read a sequence and return a reader for its contents.
Sourcepub fn read_context(&mut self, expected_tag: u32) -> Result<BerReader<'a>>
pub fn read_context(&mut self, expected_tag: u32) -> Result<BerReader<'a>>
Read a context-tagged value and return a reader for its contents.
Sourcepub fn read_application(&mut self, expected_tag: u32) -> Result<BerReader<'a>>
pub fn read_application(&mut self, expected_tag: u32) -> Result<BerReader<'a>>
Read an application-tagged value and return a reader for its contents.
Sourcepub fn read_relative_oid(&mut self) -> Result<Vec<u32>>
pub fn read_relative_oid(&mut self) -> Result<Vec<u32>>
Read a relative OID.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for BerReader<'a>
impl<'a> RefUnwindSafe for BerReader<'a>
impl<'a> Send for BerReader<'a>
impl<'a> Sync for BerReader<'a>
impl<'a> Unpin for BerReader<'a>
impl<'a> UnsafeUnpin for BerReader<'a>
impl<'a> UnwindSafe for BerReader<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more