Trait rspirv::binary::Consumer

source ·
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§

source

fn initialize(&mut self) -> Action

Intialize the consumer.

source

fn finalize(&mut self) -> Action

Finalize the consumer.

source

fn consume_header(&mut self, module: ModuleHeader) -> Action

Consume the module header.

source

fn consume_instruction(&mut self, inst: Instruction) -> Action

Consume the given instruction.

Implementors§