#[non_exhaustive]pub enum Platform {
Linux,
MacOs,
Windows,
Other(&'static str),
}Expand description
OS discriminator used by the planner and when/os predicate paths.
Kept as a plain C-style enum so matches! patterns in the planner stay
exhaustive-checked. The Platform::Other escape hatch carries a
&'static str rather than String — unsupported platforms are rare and
don’t warrant per-instance allocation.
Marked #[non_exhaustive] so dedicated tags for BSD variants, WASM, or
other platforms can land without breaking external match sites.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Linux
Linux (any distro).
MacOs
Apple macOS.
Windows
Microsoft Windows.
Other(&'static str)
Anything else (BSDs, WASM, etc.). Carries the cfg!(target_os) tag.
Implementations§
Source§impl Platform
impl Platform
Sourcepub fn matches_os_token(&self, token: &str) -> bool
pub fn matches_os_token(&self, token: &str) -> bool
Return true when token (a lowercase authored OS tag) matches self.
Accepted tokens: "windows", "linux", "macos", and the umbrella
"unix" which covers Linux + macOS. Unknown tokens are conservatively
rejected (false). The comparison is case-sensitive because action
manifests are case-normalised upstream.
Trait Implementations§
impl Copy for Platform
impl Eq for Platform
impl StructuralPartialEq for Platform
Auto Trait Implementations§
impl Freeze for Platform
impl RefUnwindSafe for Platform
impl Send for Platform
impl Sync for Platform
impl Unpin for Platform
impl UnsafeUnpin for Platform
impl UnwindSafe for Platform
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> 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<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§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 more