pub trait Emitter {
// Required methods
fn emit_function(&mut self, mf: &MachineFunction) -> Section;
fn object_format(&self) -> ObjectFormat;
// Provided methods
fn elf_machine(&self) -> u16 { ... }
fn coff_machine(&self) -> u16 { ... }
}Expand description
Implemented by each target to encode machine instructions into bytes.
Required Methods§
Sourcefn emit_function(&mut self, mf: &MachineFunction) -> Section
fn emit_function(&mut self, mf: &MachineFunction) -> Section
Encode mf and return a Section containing the machine code.
Sourcefn object_format(&self) -> ObjectFormat
fn object_format(&self) -> ObjectFormat
The object format this emitter targets.
Provided Methods§
Sourcefn elf_machine(&self) -> u16
fn elf_machine(&self) -> u16
ELF e_machine field for this target.
Sourcefn coff_machine(&self) -> u16
fn coff_machine(&self) -> u16
COFF Machine field for this target.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".