MCPcopy Create free account
hub / github.com/QuipNetwork/xquad / DecodeOperand

Interface DecodeOperand

xqvm/src/bytecode/codec.rs:117–123  ·  view source on GitHub ↗

Read an operand field's wire bytes from the start of `bytes`. Returns the decoded value and the number of bytes consumed. Used by [`impl_codec!`] to dispatch on each variant's operand list.

Source from the content-addressed store, hash-verified

115/// Returns the decoded value and the number of bytes consumed. Used by
116/// [`impl_codec!`] to dispatch on each variant's operand list.
117trait DecodeOperand: Sized {
118 /// Decode an operand of this type from the start of `bytes`.
119 ///
120 /// `opcode` identifies the instruction being decoded and is included in
121 /// truncation errors so callers can surface a precise diagnostic.
122 fn decode_from(bytes: &[u8], opcode: u8) -> Result<(Self, usize), DecodeError>;
123}
124
125impl EncodeOperand for u8 {
126 fn encode_into(&self, buf: &mut Vec<u8>) {

Callers

nothing calls this directly

Implementers 1

codec.rsxqvm/src/bytecode/codec.rs

Calls

no outgoing calls

Tested by

no test coverage detected