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.
| 115 | /// Returns the decoded value and the number of bytes consumed. Used by |
| 116 | /// [`impl_codec!`] to dispatch on each variant's operand list. |
| 117 | trait 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 | |
| 125 | impl EncodeOperand for u8 { |
| 126 | fn encode_into(&self, buf: &mut Vec<u8>) { |
nothing calls this directly
no outgoing calls
no test coverage detected