pub struct PythonVersionInfo {
pub major: u8,
pub minor: u8,
pub patch: u8,
pub suffix: Option<&'static str>,
}Expand description
Represents the major, minor, and patch (if any) versions of this interpreter.
This struct is usually created with Python::version_info.
§Examples
Python::attach(|py| {
// PyO3 supports Python 3.8 and up.
assert!(py.version_info() >= (3, 8));
assert!(py.version_info() >= (3, 8, 0));
});Fields§
§major: u8Python major version (e.g. 3).
minor: u8Python minor version (e.g. 11).
patch: u8Python patch version (e.g. 0).
suffix: Option<&'static str>Python version suffix, if applicable (e.g. a0).
Trait Implementations§
Source§impl Debug for PythonVersionInfo
impl Debug for PythonVersionInfo
Source§impl PartialOrd<(u8, u8)> for PythonVersionInfo
impl PartialOrd<(u8, u8)> for PythonVersionInfo
Auto Trait Implementations§
impl Freeze for PythonVersionInfo
impl RefUnwindSafe for PythonVersionInfo
impl Send for PythonVersionInfo
impl Sync for PythonVersionInfo
impl Unpin for PythonVersionInfo
impl UnsafeUnpin for PythonVersionInfo
impl UnwindSafe for PythonVersionInfo
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> 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