Skip to main content

Emitter

Trait Emitter 

Source
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§

Source

fn emit_function(&mut self, mf: &MachineFunction) -> Section

Encode mf and return a Section containing the machine code.

Source

fn object_format(&self) -> ObjectFormat

The object format this emitter targets.

Provided Methods§

Source

fn elf_machine(&self) -> u16

ELF e_machine field for this target.

Source

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".

Implementors§