Struct ed25519_dalek::pkcs8::spki::der::SliceReader
pub struct SliceReader<'a> { /* private fields */ }
Available on crate feature
pkcs8
only.Expand description
Reader
which consumes an input byte slice.
Implementations§
§impl<'a> SliceReader<'a>
impl<'a> SliceReader<'a>
pub fn new(bytes: &'a [u8]) -> Result<SliceReader<'a>, Error>
pub fn new(bytes: &'a [u8]) -> Result<SliceReader<'a>, Error>
Create a new slice reader for the given byte slice.
pub fn error(&mut self, kind: ErrorKind) -> Error
pub fn error(&mut self, kind: ErrorKind) -> Error
Return an error with the given ErrorKind
, annotating it with
context about where the error occurred.
pub fn value_error(&mut self, tag: Tag) -> Error
pub fn value_error(&mut self, tag: Tag) -> Error
Return an error for an invalid value with the given tag.
Trait Implementations§
§impl<'a> Clone for SliceReader<'a>
impl<'a> Clone for SliceReader<'a>
§fn clone(&self) -> SliceReader<'a>
fn clone(&self) -> SliceReader<'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 more§impl<'a> Debug for SliceReader<'a>
impl<'a> Debug for SliceReader<'a>
§impl<'a> Reader<'a> for SliceReader<'a>
impl<'a> Reader<'a> for SliceReader<'a>
§fn peek_header(&self) -> Result<Header, Error>
fn peek_header(&self) -> Result<Header, Error>
§fn read_slice(&mut self, len: Length) -> Result<&'a [u8], Error>
fn read_slice(&mut self, len: Length) -> Result<&'a [u8], Error>
Attempt to read data borrowed directly from the input as a slice,
updating the internal cursor position. Read more
§fn decode<T>(&mut self) -> Result<T, Error>where
T: Decode<'a>,
fn decode<T>(&mut self) -> Result<T, Error>where
T: Decode<'a>,
Decode a value which impls the
Decode
trait.§fn error(&mut self, kind: ErrorKind) -> Error
fn error(&mut self, kind: ErrorKind) -> Error
Return an error with the given
ErrorKind
, annotating it with
context about where the error occurred.§fn finish<T>(self, value: T) -> Result<T, Error>
fn finish<T>(self, value: T) -> Result<T, Error>
Finish decoding, returning the given value if there is no
remaining data, or an error otherwise
§fn remaining_len(&self) -> Length
fn remaining_len(&self) -> Length
Get the number of bytes still remaining in the buffer.
§fn context_specific<T>(
&mut self,
tag_number: TagNumber,
tag_mode: TagMode
) -> Result<Option<T>, Error>where
T: DecodeValue<'r> + FixedTag,
fn context_specific<T>(
&mut self,
tag_number: TagNumber,
tag_mode: TagMode
) -> Result<Option<T>, Error>where
T: DecodeValue<'r> + FixedTag,
Attempt to decode an ASN.1
CONTEXT-SPECIFIC
field with the
provided TagNumber
.§fn is_finished(&self) -> bool
fn is_finished(&self) -> bool
Have we read all of the input data?
§fn read_into<'o>(&mut self, buf: &'o mut [u8]) -> Result<&'o [u8], Error>
fn read_into<'o>(&mut self, buf: &'o mut [u8]) -> Result<&'o [u8], Error>
Attempt to read input data, writing it into the provided buffer, and
returning a slice on success. Read more
§fn read_nested<'n, T, F>(&'n mut self, len: Length, f: F) -> Result<T, Error>
fn read_nested<'n, T, F>(&'n mut self, len: Length, f: F) -> Result<T, Error>
Read nested data of the given length.
§fn read_vec(&mut self, len: Length) -> Result<Vec<u8>, Error>
fn read_vec(&mut self, len: Length) -> Result<Vec<u8>, Error>
Available on crate feature
alloc
only.Read a byte vector of the given length.
Auto Trait Implementations§
impl<'a> RefUnwindSafe for SliceReader<'a>
impl<'a> Send for SliceReader<'a>
impl<'a> Sync for SliceReader<'a>
impl<'a> Unpin for SliceReader<'a>
impl<'a> UnwindSafe for SliceReader<'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