pub struct Reader<'a> { /* private fields */ }Implementations§
Source§impl<'a> Reader<'a>
impl<'a> Reader<'a>
pub fn new(buf: &'a [u8]) -> Self
pub fn remaining(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn take(&mut self, n: usize, what: &str) -> Result<&'a [u8]>
pub fn u8(&mut self, what: &str) -> Result<u8>
pub fn u16(&mut self, what: &str) -> Result<u16>
pub fn u32(&mut self, what: &str) -> Result<u32>
pub fn i32(&mut self, what: &str) -> Result<i32>
pub fn i64(&mut self, what: &str) -> Result<i64>
pub fn f64(&mut self, what: &str) -> Result<f64>
pub fn bool(&mut self, what: &str) -> Result<bool>
Sourcepub fn presence(&mut self, what: &str) -> Result<bool>
pub fn presence(&mut self, what: &str) -> Result<bool>
opt(T) presence byte: 0x00 absent, 0x01 present, anything else a
decode error.
pub fn str(&mut self, what: &str) -> Result<String>
pub fn bytes(&mut self, what: &str) -> Result<Vec<u8>>
Sourcepub fn json(&mut self, what: &str) -> Result<RawJson>
pub fn json(&mut self, what: &str) -> Result<RawJson>
json: a str that must parse as a JSON document; the raw string is
preserved verbatim for round-trip fidelity.
Sourcepub fn blob_ref(&mut self, what: &str) -> Result<RawJson>
pub fn blob_ref(&mut self, what: &str) -> Result<RawJson>
blob_ref (§2.4 tag 7, §5.9.1): a str holding a canonical BlobRef
document; validated at decode, raw string preserved for round-trip.
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