Struct python_packaging::resource::PythonModuleBytecodeFromSource [−][src]
pub struct PythonModuleBytecodeFromSource {
pub name: String,
pub source: FileData,
pub optimize_level: BytecodeOptimizationLevel,
pub is_package: bool,
pub cache_tag: String,
pub is_stdlib: bool,
pub is_test: bool,
}
Expand description
Python module bytecode defined via source code.
This is essentially a request to generate bytecode from Python module source code.
Fields
name: String
source: FileData
optimize_level: BytecodeOptimizationLevel
is_package: bool
cache_tag: String
Tag to apply to bytecode files.
e.g. cpython-39
.
is_stdlib: bool
Whether this module belongs to the Python standard library.
Modules with this set are distributed as part of Python itself.
is_test: bool
Whether this module is a test module.
Test modules are those defining test code and aren’t critical to run-time functionality of a package.
Implementations
pub fn compile(
&self,
compiler: &mut dyn PythonBytecodeCompiler,
mode: CompileMode
) -> Result<Vec<u8>>
pub fn compile(
&self,
compiler: &mut dyn PythonBytecodeCompiler,
mode: CompileMode
) -> Result<Vec<u8>>
Compile source to bytecode using a compiler.
Resolve filesystem path to this bytecode.
Whether the source for this module has file.
Trait Implementations
Performs the conversion.
Performs the conversion.
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl Send for PythonModuleBytecodeFromSource
impl Sync for PythonModuleBytecodeFromSource
impl Unpin for PythonModuleBytecodeFromSource
impl UnwindSafe for PythonModuleBytecodeFromSource
Blanket Implementations
Mutably borrows from an owned value. Read more