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]
fn code(&self) -> PyResult<u32> {
Ok(self.0.code)
fn code(&self) -> u32 {
self.0.code
}
#[getter]
fn addr(&self) -> PyResult<u32> {
Ok(self.0.addr)
fn addr(&self) -> u32 {
self.0.addr
}
#[getter]
fn opcode(&self) -> &'static str {
self.0.op.mnemonic()
}
fn __str__(&self) -> String {