pub struct PythonVersionInfo<'a> {
    pub major: u8,
    pub minor: u8,
    pub patch: u8,
    pub suffix: Option<&'a str>,
}Expand description
Represents the major, minor, and patch (if any) versions of this interpreter.
This struct is usually created with Python::version.
§Examples
Python::with_gil(|py| {
    // PyO3 supports Python 3.7 and up.
    assert!(py.version_info() >= (3, 7));
    assert!(py.version_info() >= (3, 7, 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<&'a str>Python version suffix, if applicable (e.g. a0).
Implementations§
Source§impl<'a> PythonVersionInfo<'a>
 
impl<'a> PythonVersionInfo<'a>
Trait Implementations§
Source§impl<'a> Debug for PythonVersionInfo<'a>
 
impl<'a> Debug for PythonVersionInfo<'a>
Source§impl PartialOrd<(u8, u8)> for PythonVersionInfo<'_>
 
impl PartialOrd<(u8, u8)> for PythonVersionInfo<'_>
Source§#[doc(hidden)] fn __chaining_lt(&self, other: &Rhs) -> ControlFlow<bool>
 
#[doc(hidden)] fn __chaining_lt(&self, other: &Rhs) -> ControlFlow<bool>
🔬This is a nightly-only experimental API. (
partial_ord_chaining_methods)If 
self == other, returns ControlFlow::Continue(()).
Otherwise, returns ControlFlow::Break(self < other). Read moreSource§#[doc(hidden)] fn __chaining_le(&self, other: &Rhs) -> ControlFlow<bool>
 
#[doc(hidden)] fn __chaining_le(&self, other: &Rhs) -> ControlFlow<bool>
🔬This is a nightly-only experimental API. (
partial_ord_chaining_methods)Same as 
__chaining_lt, but for <= instead of <.Source§#[doc(hidden)] fn __chaining_gt(&self, other: &Rhs) -> ControlFlow<bool>
 
#[doc(hidden)] fn __chaining_gt(&self, other: &Rhs) -> ControlFlow<bool>
🔬This is a nightly-only experimental API. (
partial_ord_chaining_methods)Same as 
__chaining_lt, but for > instead of <.Source§#[doc(hidden)] fn __chaining_ge(&self, other: &Rhs) -> ControlFlow<bool>
 
#[doc(hidden)] fn __chaining_ge(&self, other: &Rhs) -> ControlFlow<bool>
🔬This is a nightly-only experimental API. (
partial_ord_chaining_methods)Same as 
__chaining_lt, but for >= instead of <.Source§impl PartialOrd<(u8, u8, u8)> for PythonVersionInfo<'_>
 
impl PartialOrd<(u8, u8, u8)> for PythonVersionInfo<'_>
Source§#[doc(hidden)] fn __chaining_lt(&self, other: &Rhs) -> ControlFlow<bool>
 
#[doc(hidden)] fn __chaining_lt(&self, other: &Rhs) -> ControlFlow<bool>
🔬This is a nightly-only experimental API. (
partial_ord_chaining_methods)If 
self == other, returns ControlFlow::Continue(()).
Otherwise, returns ControlFlow::Break(self < other). Read moreSource§#[doc(hidden)] fn __chaining_le(&self, other: &Rhs) -> ControlFlow<bool>
 
#[doc(hidden)] fn __chaining_le(&self, other: &Rhs) -> ControlFlow<bool>
🔬This is a nightly-only experimental API. (
partial_ord_chaining_methods)Same as 
__chaining_lt, but for <= instead of <.Source§#[doc(hidden)] fn __chaining_gt(&self, other: &Rhs) -> ControlFlow<bool>
 
#[doc(hidden)] fn __chaining_gt(&self, other: &Rhs) -> ControlFlow<bool>
🔬This is a nightly-only experimental API. (
partial_ord_chaining_methods)Same as 
__chaining_lt, but for > instead of <.Source§#[doc(hidden)] fn __chaining_ge(&self, other: &Rhs) -> ControlFlow<bool>
 
#[doc(hidden)] fn __chaining_ge(&self, other: &Rhs) -> ControlFlow<bool>
🔬This is a nightly-only experimental API. (
partial_ord_chaining_methods)Same as 
__chaining_lt, but for >= instead of <.Auto Trait Implementations§
impl<'a> Freeze for PythonVersionInfo<'a>
impl<'a> RefUnwindSafe for PythonVersionInfo<'a>
impl<'a> Send for PythonVersionInfo<'a>
impl<'a> Sync for PythonVersionInfo<'a>
impl<'a> Unpin for PythonVersionInfo<'a>
impl<'a> UnwindSafe for PythonVersionInfo<'a>
Blanket Implementations§
Source§impl<T> AssertNotZeroSized for T
 
impl<T> AssertNotZeroSized for T
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 moreSource§impl<T> SizedTypeProperties for T
 
impl<T> SizedTypeProperties for T
Source§#[doc(hidden)] const IS_ZST: bool = _
 
#[doc(hidden)] const IS_ZST: bool = _
🔬This is a nightly-only experimental API. (
sized_type_properties)Source§#[doc(hidden)] const LAYOUT: Layout = _
 
#[doc(hidden)] const LAYOUT: Layout = _
🔬This is a nightly-only experimental API. (
sized_type_properties)Source§#[doc(hidden)] const MAX_SLICE_LEN: usize = _
 
#[doc(hidden)] const MAX_SLICE_LEN: usize = _
🔬This is a nightly-only experimental API. (
sized_type_properties)The largest safe length for a 
[Self]. Read more