Struct pulley_interpreter::decode::SafeBytecodeStream
source · 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)