pub struct PythonEnvironment {
pub mini_python: PathBuf,
pub include_dir: PathBuf,
pub include_flag: String,
pub lib_dir: PathBuf,
pub lib_path: PathBuf,
pub version: PythonVersion,
pub package_source: PackageSource,
}Expand description
Complete Python environment information for Simics
Fields§
§mini_python: PathBufPath to mini-python executable
include_dir: PathBufPath to Python include directory (contains python3.X subdirectory)
include_flag: StringInclude flag for C compilation (e.g., “-I/path/to/include/python3.9”)
lib_dir: PathBufDirectory containing libpython*.so files
lib_path: PathBufFull path to the specific libpython*.so file
version: PythonVersionParsed Python version information
package_source: PackageSourceSource package where Python was found
Implementations§
Source§impl PythonEnvironment
impl PythonEnvironment
Sourcepub fn new(
mini_python: PathBuf,
include_dir: PathBuf,
lib_dir: PathBuf,
lib_path: PathBuf,
version: PythonVersion,
package_source: PackageSource,
) -> Self
pub fn new( mini_python: PathBuf, include_dir: PathBuf, lib_dir: PathBuf, lib_path: PathBuf, version: PythonVersion, package_source: PackageSource, ) -> Self
Create a new Python environment
Sourcepub fn with_source(self, source: PackageSource) -> Self
pub fn with_source(self, source: PackageSource) -> Self
Set the package source for this environment
Sourcepub fn major_version_str(&self) -> String
pub fn major_version_str(&self) -> String
Get the Python major version as string
Sourcepub fn minor_version_str(&self) -> String
pub fn minor_version_str(&self) -> String
Get the Python minor version as string
Sourcepub fn py_limited_api_define(&self) -> String
pub fn py_limited_api_define(&self) -> String
Get the Py_LIMITED_API define for C compilation
Sourcepub fn lib_filename(&self) -> Result<String>
pub fn lib_filename(&self) -> Result<String>
Get the library file name (without directory)
Trait Implementations§
Source§impl Clone for PythonEnvironment
impl Clone for PythonEnvironment
Source§fn clone(&self) -> PythonEnvironment
fn clone(&self) -> PythonEnvironment
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 PythonEnvironment
impl Debug for PythonEnvironment
Auto Trait Implementations§
impl Freeze for PythonEnvironment
impl RefUnwindSafe for PythonEnvironment
impl Send for PythonEnvironment
impl Sync for PythonEnvironment
impl Unpin for PythonEnvironment
impl UnwindSafe for PythonEnvironment
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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