[][src]Trait python_packaging::bytecode::PythonBytecodeCompiler

pub trait PythonBytecodeCompiler {
    fn get_magic_number(&self) -> u32;
fn compile(
        &mut self,
        source: &[u8],
        filename: &str,
        optimize: BytecodeOptimizationLevel,
        output_mode: CompileMode
    ) -> Result<Vec<u8>>; }

An entity that can compile Python bytecode.

Required methods

fn get_magic_number(&self) -> u32

Obtain the magic number to use in the bytecode header.

fn compile(
    &mut self,
    source: &[u8],
    filename: &str,
    optimize: BytecodeOptimizationLevel,
    output_mode: CompileMode
) -> Result<Vec<u8>>

Compile Python source into bytecode with an optimization level.

Loading content...

Implementors

impl PythonBytecodeCompiler for BytecodeCompiler[src]

Loading content...