pub enum TargetPlatform {
Android,
Fuchsia,
Ios,
Linux,
MacOs,
Windows,
}Expand description
The platforms whose conventions a widget can follow.
Every platform a frus application can run on has its own value, rather than borrowing another’s: a platform folded into another at the start can never be given behaviour of its own without breaking every application that relied on it.
Variants§
Android
Android.
Fuchsia
Fuchsia.
Ios
iOS and iPadOS.
Linux
Linux and the other free Unix desktops.
MacOs
macOS.
Windows
Windows.
Implementations§
Source§impl TargetPlatform
impl TargetPlatform
Sourcepub const ALL: [TargetPlatform; 6]
pub const ALL: [TargetPlatform; 6]
Every platform, in declaration order.
Sourcepub const fn of_build() -> TargetPlatform
pub const fn of_build() -> TargetPlatform
The platform this binary was built for. A web build, which is built for no
operating system, reports Android here: what the browser runs on is
default_target_platform’s business.
Sourcepub fn from_browser(
platform: &str,
user_agent: &str,
max_touch_points: i32,
) -> TargetPlatform
pub fn from_browser( platform: &str, user_agent: &str, max_touch_points: i32, ) -> TargetPlatform
The platform a browser runs on, from what its navigator says: navigator.platform,
navigator.userAgent and navigator.maxTouchPoints.
An iPad asks for desktop pages and says it is a Mac; it is told apart by its touch
screen. Android’s platform is a Linux, so the user agent is asked first. Anything
unrecognised is Android.
Sourcepub const fn is_apple(self) -> bool
pub const fn is_apple(self) -> bool
iOS or macOS: the platforms that share Apple’s conventions.
Sourcepub const fn is_mobile(self) -> bool
pub const fn is_mobile(self) -> bool
Android, Fuchsia or iOS: the platforms driven by touch first.
Sourcepub const fn is_desktop(self) -> bool
pub const fn is_desktop(self) -> bool
Linux, macOS or Windows: the platforms driven by a mouse and a keyboard first.
Trait Implementations§
Source§impl Clone for TargetPlatform
impl Clone for TargetPlatform
Source§fn clone(&self) -> TargetPlatform
fn clone(&self) -> TargetPlatform
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for TargetPlatform
Source§impl Debug for TargetPlatform
impl Debug for TargetPlatform
Source§impl Display for TargetPlatform
impl Display for TargetPlatform
impl Eq for TargetPlatform
Source§impl Hash for TargetPlatform
impl Hash for TargetPlatform
Source§impl PartialEq for TargetPlatform
impl PartialEq for TargetPlatform
impl StructuralPartialEq for TargetPlatform
Auto Trait Implementations§
impl Freeze for TargetPlatform
impl RefUnwindSafe for TargetPlatform
impl Send for TargetPlatform
impl Sync for TargetPlatform
impl Unpin for TargetPlatform
impl UnsafeUnpin for TargetPlatform
impl UnwindSafe for TargetPlatform
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
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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.