pub enum Os {
Ios,
Android,
MacOs,
Windows,
Linux,
Web,
}Expand description
The operating system (platform.os).
Variants§
Ios
iOS, iPadOS, Mac Catalyst.
Android
Android.
MacOs
macOS (a desktop backend).
Windows
Windows.
Linux
Linux.
Web
A web browser (the WebAssembly runtime): phone, tablet or desktop
by Idiom.
Implementations§
Source§impl Os
impl Os
Sourcepub fn is_desktop(self) -> bool
pub fn is_desktop(self) -> bool
The OS of a desktop backend (macOS, Windows, Linux): it has windows
and menus (nsh/desktop’s isAvailable). Desktop behavior
(desktop={{…}} props, platform.select({ desktop }),
platform.desktop) also covers browsers in the desktop idiom:
Environment::desktop.
Sourcepub fn is_catalyst(self) -> bool
pub fn is_catalyst(self) -> bool
iOS running under Mac Catalyst, in every idiom (platform.catalyst):
this build is Catalyst’s (target_abi = "macabi"). Catalyst runs the
iOS backend, so it is mobile, not desktop: ios={{…}} props apply and
nsh/desktop’s window and menu APIs are not there.
Trait Implementations§
impl Copy for Os
impl Eq for Os
impl StructuralPartialEq for Os
Auto Trait Implementations§
impl Forget for Os
impl Freeze for Os
impl Move for Os
impl RefUnwindSafe for Os
impl Send for Os
impl Sync for Os
impl Unpin for Os
impl UnsafeUnpin for Os
impl UnwindSafe for Os
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.