Skip to main content

ras/encoder/
traits.rs

1//! Instruction encoder trait
2
3use crate::error::RasError;
4
5#[derive(Debug, Clone)]
6pub struct ParsedInstruction {
7    pub opcode: String,
8    pub operands: Vec<String>,
9}
10
11pub trait InstructionEncoder {
12    fn encode_instruction(&mut self, inst: &ParsedInstruction) -> Result<Vec<u8>, RasError>;
13
14    fn current_position(&self) -> usize;
15}