pub struct OSVersion {
pub major: u16,
pub minor: u8,
pub patch: u8,
}Expand description
Deployment target or SDK version.
The size of the numbers in here are limited by Mach-O’s LC_BUILD_VERSION.
Fields§
§major: u16§minor: u8§patch: u8Implementations§
Source§impl OSVersion
impl OSVersion
pub fn new(major: u16, minor: u8, patch: u8) -> Self
pub fn fmt_pretty(self) -> impl Display
pub fn fmt_full(self) -> impl Display
Sourcepub fn os_minimum_deployment_target(os: &str) -> Self
pub fn os_minimum_deployment_target(os: &str) -> Self
Minimum operating system versions currently supported by rustc.
Sourcepub fn minimum_deployment_target(target: &Target) -> Self
pub fn minimum_deployment_target(target: &Target) -> Self
The deployment target for the given target.
This is similar to os_minimum_deployment_target, except that on certain targets it makes sense
to raise the minimum OS version.
This matches what LLVM does, see in part: https://github.com/llvm/llvm-project/blob/llvmorg-18.1.8/llvm/lib/TargetParser/Triple.cpp#L1900-L1932
Trait Implementations§
Source§impl FromStr for OSVersion
impl FromStr for OSVersion
Source§fn from_str(version: &str) -> Result<Self, ParseIntError>
fn from_str(version: &str) -> Result<Self, ParseIntError>
Parse an OS version triple (SDK version or deployment target).
Source§type Err = ParseIntError
type Err = ParseIntError
Source§impl Ord for OSVersion
impl Ord for OSVersion
Source§impl PartialOrd for OSVersion
impl PartialOrd for OSVersion
impl Copy for OSVersion
impl Eq for OSVersion
impl StructuralPartialEq for OSVersion
Auto Trait Implementations§
impl DynSend for OSVersion
impl DynSync for OSVersion
impl Freeze for OSVersion
impl RefUnwindSafe for OSVersion
impl Send for OSVersion
impl Sync for OSVersion
impl Unpin for OSVersion
impl UnwindSafe for OSVersion
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
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
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> 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>
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>
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> Pointable for T
impl<T> Pointable for T
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<T> ErasedDestructor for Twhere
T: 'static,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 4 bytes