pub struct SafeBytecodeStream<'a> { /* private fields */ }
Available on crate feature
decode
only.Expand description
A 100% safe implementation of a bytecode stream.
This is a thin wrapper around an index into a &[u8]
.
Implementations§
Source§impl<'a> SafeBytecodeStream<'a>
impl<'a> SafeBytecodeStream<'a>
Trait Implementations§
Source§impl BytecodeStream for SafeBytecodeStream<'_>
impl BytecodeStream for SafeBytecodeStream<'_>
Source§type Error = DecodingError
type Error = DecodingError
The type of error that this bytecode stream produces on invalid
operations.
Source§fn read<const N: usize>(&mut self) -> Result<[u8; N], Self::Error>
fn read<const N: usize>(&mut self) -> Result<[u8; N], Self::Error>
Read
N
bytes from this bytecode stream, advancing the stream’s
position at the same time.Source§fn unexpected_eof(&self) -> Self::Error
fn unexpected_eof(&self) -> Self::Error
Create an “unexpected end-of-stream” error at the current position.
Source§fn invalid_opcode(&self, code: u8) -> Self::Error
fn invalid_opcode(&self, code: u8) -> Self::Error
Create an “invalid opcode” error at the current position.
Source§fn invalid_extended_opcode(&self, code: u16) -> Self::Error
fn invalid_extended_opcode(&self, code: u16) -> Self::Error
Create an “invalid extended opcode” error at the current position.
Source§fn invalid_reg(&self, reg: u8) -> Self::Error
fn invalid_reg(&self, reg: u8) -> Self::Error
Create an “invalid register” error at the current position.
Source§impl<'a> Clone for SafeBytecodeStream<'a>
impl<'a> Clone for SafeBytecodeStream<'a>
Source§fn clone(&self) -> SafeBytecodeStream<'a>
fn clone(&self) -> SafeBytecodeStream<'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 moreSource§impl<'a> Debug for SafeBytecodeStream<'a>
impl<'a> Debug for SafeBytecodeStream<'a>
impl<'a> Copy for SafeBytecodeStream<'a>
Auto Trait Implementations§
impl<'a> Freeze for SafeBytecodeStream<'a>
impl<'a> RefUnwindSafe for SafeBytecodeStream<'a>
impl<'a> Send for SafeBytecodeStream<'a>
impl<'a> Sync for SafeBytecodeStream<'a>
impl<'a> Unpin for SafeBytecodeStream<'a>
impl<'a> UnwindSafe for SafeBytecodeStream<'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