Skip to main content

PythonEnvironment

Struct PythonEnvironment 

Source
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: PathBuf

Path to mini-python executable

§include_dir: PathBuf

Path to Python include directory (contains python3.X subdirectory)

§include_flag: String

Include flag for C compilation (e.g., “-I/path/to/include/python3.9”)

§lib_dir: PathBuf

Directory containing libpython*.so files

§lib_path: PathBuf

Full path to the specific libpython*.so file

§version: PythonVersion

Parsed Python version information

§package_source: PackageSource

Source package where Python was found

Implementations§

Source§

impl PythonEnvironment

Source

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

Source

pub fn with_source(self, source: PackageSource) -> Self

Set the package source for this environment

Source

pub fn validate(&self) -> Result<()>

Validate that all required files and directories exist

Source

pub fn major_version_str(&self) -> String

Get the Python major version as string

Source

pub fn minor_version_str(&self) -> String

Get the Python minor version as string

Source

pub fn py_limited_api_define(&self) -> String

Get the Py_LIMITED_API define for C compilation

Source

pub fn lib_filename(&self) -> Result<String>

Get the library file name (without directory)

Trait Implementations§

Source§

impl Clone for PythonEnvironment

Source§

fn clone(&self) -> PythonEnvironment

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PythonEnvironment

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for PythonEnvironment

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more