pub trait PcodeSink {
// Required methods
fn op(
&mut self,
opcode: Opcode,
output: Option<Varnode>,
inputs: &[Varnode],
);
fn label(&mut self, label: LabelId);
fn branch_label(
&mut self,
opcode: Opcode,
label: LabelId,
condition: Option<Varnode>,
);
}Expand description
Receives resolved p-code operations as an instruction is emitted.
Operations arrive in execution order. Sinks are infallible: a consumer that can fail records its own error and ignores the rest of the instruction, because a partially emitted instruction is discarded by its caller.
Required Methods§
Sourcefn op(&mut self, opcode: Opcode, output: Option<Varnode>, inputs: &[Varnode])
fn op(&mut self, opcode: Opcode, output: Option<Varnode>, inputs: &[Varnode])
Receives one resolved operation. inputs is borrowed for the call
only, so a sink which needs to retain the operation must copy it.
Sourcefn label(&mut self, label: LabelId)
fn label(&mut self, label: LabelId)
Marks the position of an instruction-local label: the next operation reported is its target.
Sourcefn branch_label(
&mut self,
opcode: Opcode,
label: LabelId,
condition: Option<Varnode>,
)
fn branch_label( &mut self, opcode: Opcode, label: LabelId, condition: Option<Varnode>, )
Receives a branch whose target is instruction-local. opcode is
Opcode::Branch or Opcode::CBranch, and condition is present
exactly for the latter.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".