pub struct Reader<'a> { /* private fields */ }Expand description
Reads TLVs out of one DER buffer, left to right.
Implementations§
Source§impl<'a> Reader<'a>
impl<'a> Reader<'a>
pub fn new(b: &'a [u8]) -> Self
pub fn is_empty(&self) -> bool
Sourcepub fn expect(&mut self, tag: u8, what: &'static str) -> Result<&'a [u8]>
pub fn expect(&mut self, tag: u8, what: &'static str) -> Result<&'a [u8]>
Next TLV, which must carry tag.
Sourcepub fn peek_optional(&mut self, tag: u8) -> Option<&'a [u8]>
pub fn peek_optional(&mut self, tag: u8) -> Option<&'a [u8]>
Next TLV if it carries tag; otherwise nothing is consumed.
Auto Trait Implementations§
impl<'a> Freeze for Reader<'a>
impl<'a> RefUnwindSafe for Reader<'a>
impl<'a> Send for Reader<'a>
impl<'a> Sync for Reader<'a>
impl<'a> Unpin for Reader<'a>
impl<'a> UnsafeUnpin for Reader<'a>
impl<'a> UnwindSafe for Reader<'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