pub struct DecodeArena { /* private fields */ }Expand description
Owns stable byte buffers allocated during a decode.
Implementations§
Source§impl DecodeArena
impl DecodeArena
Sourcepub fn alloc(
&self,
ctx: &DecodeContext<'_>,
bytes: Box<[u8]>,
) -> Result<&[u8], CodecError>
pub fn alloc( &self, ctx: &DecodeContext<'_>, bytes: Box<[u8]>, ) -> Result<&[u8], CodecError>
Stores bytes and returns a borrow valid for the arena’s lifetime.
The returned slice is stable: later alloc calls never invalidate it.
Trait Implementations§
Source§impl Debug for DecodeArena
impl Debug for DecodeArena
Auto Trait Implementations§
impl !Freeze for DecodeArena
impl !RefUnwindSafe for DecodeArena
impl !Sync for DecodeArena
impl Send for DecodeArena
impl Unpin for DecodeArena
impl UnsafeUnpin for DecodeArena
impl UnwindSafe for DecodeArena
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