pub trait Consumer {
// Required methods
fn initialize(&mut self) -> Action;
fn finalize(&mut self) -> Action;
fn consume_header(&mut self, module: ModuleHeader) -> Action;
fn consume_instruction(&mut self, inst: Instruction) -> Action;
}
Expand description
The binary consumer trait.
The parser will call initialize
before parsing the SPIR-V binary and
finalize
after successfully parsing the whle binary.
After successfully parsing the module header, consume_header
will be
called. After successfully parsing an instruction, consume_instruction
will be called.
The consumer can use Action
to control the
parsing process.
Required Methods§
sourcefn initialize(&mut self) -> Action
fn initialize(&mut self) -> Action
Intialize the consumer.
sourcefn consume_header(&mut self, module: ModuleHeader) -> Action
fn consume_header(&mut self, module: ModuleHeader) -> Action
Consume the module header.
sourcefn consume_instruction(&mut self, inst: Instruction) -> Action
fn consume_instruction(&mut self, inst: Instruction) -> Action
Consume the given instruction.