pub struct PythonVersion {
pub major: u32,
pub minor: u32,
pub patch: Option<u32>,
}Expand description
A Python version with major, minor, and optional patch
Fields§
§major: u32§minor: u32§patch: Option<u32>Implementations§
Source§impl PythonVersion
impl PythonVersion
Sourcepub fn matches(&self, spec: &PythonVersion) -> bool
pub fn matches(&self, spec: &PythonVersion) -> bool
Check if this version matches a specification (e.g., “3.12” matches “3.12.1”)
Sourcepub fn to_string_full(&self) -> String
pub fn to_string_full(&self) -> String
Get the version string (e.g., “3.12.1” or “3.12”)
Sourcepub fn to_string_short(&self) -> String
pub fn to_string_short(&self) -> String
Get the major.minor string (e.g., “3.12”)
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 FromStr for PythonVersion
impl FromStr for PythonVersion
Source§impl Hash for PythonVersion
impl Hash for PythonVersion
Source§impl Ord for PythonVersion
impl Ord for PythonVersion
Source§impl PartialEq for PythonVersion
impl PartialEq for PythonVersion
Source§impl PartialOrd for PythonVersion
impl PartialOrd 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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.