pub struct PythonModuleBytecode {
pub name: String,
pub optimize_level: BytecodeOptimizationLevel,
pub is_package: bool,
pub cache_tag: String,
pub is_stdlib: bool,
pub is_test: bool,
/* private fields */
}Expand description
Compiled Python module bytecode.
Fields§
§name: String§optimize_level: BytecodeOptimizationLevel§is_package: bool§cache_tag: StringTag to apply to bytecode files.
e.g. cpython-39.
is_stdlib: boolWhether this module belongs to the Python standard library.
Modules with this set are distributed as part of Python itself.
is_test: boolWhether 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§
Source§impl PythonModuleBytecode
impl PythonModuleBytecode
pub fn new( name: &str, optimize_level: BytecodeOptimizationLevel, is_package: bool, cache_tag: &str, data: &[u8], ) -> Self
pub fn from_path( name: &str, optimize_level: BytecodeOptimizationLevel, cache_tag: &str, path: &Path, ) -> Self
pub fn description(&self) -> String
pub fn to_memory(&self) -> Result<Self>
Sourcepub fn resolve_bytecode(&self) -> Result<Vec<u8>>
pub fn resolve_bytecode(&self) -> Result<Vec<u8>>
Resolve the bytecode data for this module.
Sourcepub fn set_bytecode(&mut self, data: &[u8])
pub fn set_bytecode(&mut self, data: &[u8])
Sets the bytecode for this module.
Sourcepub fn resolve_path(&self, prefix: &str) -> PathBuf
pub fn resolve_path(&self, prefix: &str) -> PathBuf
Resolve filesystem path to this bytecode.
Trait Implementations§
Source§impl Clone for PythonModuleBytecode
impl Clone for PythonModuleBytecode
Source§fn clone(&self) -> PythonModuleBytecode
fn clone(&self) -> PythonModuleBytecode
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PythonModuleBytecode
impl Debug for PythonModuleBytecode
Source§impl<'a> From<&'a PythonModuleBytecode> for PythonResource<'a>
impl<'a> From<&'a PythonModuleBytecode> for PythonResource<'a>
Source§fn from(m: &'a PythonModuleBytecode) -> Self
fn from(m: &'a PythonModuleBytecode) -> Self
Converts to this type from the input type.
Source§impl<'a> From<PythonModuleBytecode> for PythonResource<'a>
impl<'a> From<PythonModuleBytecode> for PythonResource<'a>
Source§fn from(m: PythonModuleBytecode) -> Self
fn from(m: PythonModuleBytecode) -> Self
Converts to this type from the input type.
Source§impl PartialEq for PythonModuleBytecode
impl PartialEq for PythonModuleBytecode
impl StructuralPartialEq for PythonModuleBytecode
Auto Trait Implementations§
impl Freeze for PythonModuleBytecode
impl RefUnwindSafe for PythonModuleBytecode
impl Send for PythonModuleBytecode
impl Sync for PythonModuleBytecode
impl Unpin for PythonModuleBytecode
impl UnwindSafe for PythonModuleBytecode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more