pub struct DecodeContext<'a> { /* private fields */ }Expand description
Stateful resource budget shared by one complete protocol decode.
Implementations§
Source§impl<'a> DecodeContext<'a>
impl<'a> DecodeContext<'a>
Sourcepub fn claim_records(&mut self, count: u32) -> Result<(), DecodeError>
pub fn claim_records(&mut self, count: u32) -> Result<(), DecodeError>
Charges records against the aggregate budget before constructing them.
Sourcepub fn claim_allocation(&mut self, bytes: u32) -> Result<(), DecodeError>
pub fn claim_allocation(&mut self, bytes: u32) -> Result<(), DecodeError>
Charges bytes against the aggregate allocation budget before allocation.
Sourcepub fn copy_bytes(&mut self, source: &[u8]) -> Result<Vec<u8>, DecodeError>
pub fn copy_bytes(&mut self, source: &[u8]) -> Result<Vec<u8>, DecodeError>
Charges and copies hostile bytes into owned storage.
Auto Trait Implementations§
impl<'a> Freeze for DecodeContext<'a>
impl<'a> RefUnwindSafe for DecodeContext<'a>
impl<'a> Send for DecodeContext<'a>
impl<'a> Sync for DecodeContext<'a>
impl<'a> Unpin for DecodeContext<'a>
impl<'a> UnsafeUnpin for DecodeContext<'a>
impl<'a> UnwindSafe for DecodeContext<'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