disasm-py: add opcode getter

This commit is contained in:
Richard Patel 2022-04-07 06:01:25 +02:00
parent fcad8da86b
commit 9c433919fc
1 changed files with 9 additions and 4 deletions

View File

@ -14,13 +14,18 @@ impl Ins {
} }
#[getter] #[getter]
fn code(&self) -> PyResult<u32> { fn code(&self) -> u32 {
Ok(self.0.code) self.0.code
} }
#[getter] #[getter]
fn addr(&self) -> PyResult<u32> { fn addr(&self) -> u32 {
Ok(self.0.addr) self.0.addr
}
#[getter]
fn opcode(&self) -> &'static str {
self.0.op.mnemonic()
} }
fn __str__(&self) -> String { fn __str__(&self) -> String {