pub struct PythonVersion {
pub major: u32,
pub minor: u32,
pub patch: u32,
}Expand description
Python version information parsed from include directory
Fields§
§major: u32Major version number (e.g., 3)
minor: u32Minor version number (e.g., 9)
patch: u32Patch version number (e.g., 10)
Implementations§
Source§impl PythonVersion
impl PythonVersion
Sourcepub fn py_limited_api_hex(&self) -> String
pub fn py_limited_api_hex(&self) -> String
Generate Py_LIMITED_API hex value for this Python version
Format: 0xMMmmpppp where MM=major, mm=minor, pppp=patch*1000 Example: Python 3.9.10 -> 0x03090000 (patch is truncated to 0 for API compatibility)
Sourcepub fn parse_from_include_dir<P: AsRef<Path>>(include_dir: P) -> Result<Self>
pub fn parse_from_include_dir<P: AsRef<Path>>(include_dir: P) -> Result<Self>
Parse Python version from include directory name
Expects directory names like “python3.9” or “python3.9.10”
Trait Implementations§
Source§impl Clone for PythonVersion
impl Clone for PythonVersion
Source§fn clone(&self) -> PythonVersion
fn clone(&self) -> PythonVersion
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 PythonVersion
impl Debug for PythonVersion
Source§impl Display for PythonVersion
impl Display for PythonVersion
Source§impl PartialEq for PythonVersion
impl PartialEq for PythonVersion
impl Eq for PythonVersion
impl StructuralPartialEq for PythonVersion
Auto Trait Implementations§
impl Freeze for PythonVersion
impl RefUnwindSafe for PythonVersion
impl Send for PythonVersion
impl Sync for PythonVersion
impl Unpin for PythonVersion
impl UnwindSafe for PythonVersion
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