pub struct Capabilities {
pub can_quit: bool,
}Expand description
Static feature-flag struct describing what the host environment
supports. Each platform impl exposes a CAPABILITIES constant of
this type. UI / input code reads it to gate affordances that have
no meaning on a given platform — e.g. the [q] quit help-bar hint
is hidden in the browser, where the wasm bundle has no authority
to close the tab.
Add new fields here when a feature genuinely diverges between
surfaces (and add the matching value to both native::CAPABILITIES
and web::CAPABILITIES); don’t reach for cfg(target_arch) deeper
in the tree if a capability flag fits the seam.
Fields§
§can_quit: boolWhether the player can quit the running instance from inside the game. True on native (terminal close = process exit). False on web — the wasm has no authority over the tab; the player closes the page or navigates away themselves.
Trait Implementations§
Source§impl Clone for Capabilities
impl Clone for Capabilities
Source§fn clone(&self) -> Capabilities
fn clone(&self) -> Capabilities
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Capabilities
impl Debug for Capabilities
impl Copy for Capabilities
Auto Trait Implementations§
impl Freeze for Capabilities
impl RefUnwindSafe for Capabilities
impl Send for Capabilities
impl Sync for Capabilities
impl Unpin for Capabilities
impl UnsafeUnpin for Capabilities
impl UnwindSafe for Capabilities
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<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