Struct InteractionEnvironment
pub struct InteractionEnvironment {
pub modality: InputModality,
pub pointer_precision: PointerPrecision,
pub available: InputAvailability,
pub controller: Option<ControllerFamily>,
pub keyboard_family: KeyboardFamily,
}Expand description
Runtime interaction information propagated by the host to every widget.
Fields§
§modality: InputModality§pointer_precision: PointerPrecision§available: InputAvailability§controller: Option<ControllerFamily>§keyboard_family: KeyboardFamilyImplementations§
§impl InteractionEnvironment
impl InteractionEnvironment
pub const POINTER: InteractionEnvironment
pub const TOUCH: InteractionEnvironment
pub const fn minimum_target(self) -> f32
pub const fn minimum_target(self) -> f32
Minimum square target controls should expose in logical pixels.
pub fn minimum_target_rect(self, visual: Rect) -> Rect
pub const fn supports_hover(self) -> bool
pub const fn supports_hover(self) -> bool
Hover affordances have no meaning for a coarse direct pointer.
pub const fn preferred_hint_modality(self) -> InputModality
pub const fn preferred_hint_modality(self) -> InputModality
Input language to lead with in shortcut help: the one the person used last. Typing after touch leads with keyboard shortcuts, touching after typing leads with gestures, and a controller leads only while it is still connected. Pointer use carries no instructions of its own, so it defers to keyboard hints when a keyboard exists and to gestures on a touch-only device.
pub const fn minimum_collection_row(self) -> f32
pub const fn minimum_collection_row(self) -> f32
Minimum vertical extent for adjacent full-width collection rows. Fine pointers can distinguish compact rows; direct touch cannot.
pub const fn with_keyboard_modality(self) -> InteractionEnvironment
pub const fn with_keyboard_modality(self) -> InteractionEnvironment
Preserve pointer capability while recording keyboard navigation.
pub const fn with_pointer_modality(self) -> InteractionEnvironment
pub const fn with_pointer_modality(self) -> InteractionEnvironment
Record pointer use while preserving every previously discovered device.
pub const fn with_touch_modality(self) -> InteractionEnvironment
pub const fn with_touch_modality(self) -> InteractionEnvironment
Record direct touch while preserving keyboard, mouse and controller availability for multi-device systems such as convertibles.
pub const fn with_controller(
self,
family: ControllerFamily,
) -> InteractionEnvironment
pub const fn with_controller( self, family: ControllerFamily, ) -> InteractionEnvironment
Record a controller event and retain its physical legend family.
Trait Implementations§
§impl Clone for InteractionEnvironment
impl Clone for InteractionEnvironment
§fn clone(&self) -> InteractionEnvironment
fn clone(&self) -> InteractionEnvironment
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for InteractionEnvironment
impl Debug for InteractionEnvironment
§impl Default for InteractionEnvironment
impl Default for InteractionEnvironment
§fn default() -> InteractionEnvironment
fn default() -> InteractionEnvironment
§impl PartialEq for InteractionEnvironment
impl PartialEq for InteractionEnvironment
§fn eq(&self, other: &InteractionEnvironment) -> bool
fn eq(&self, other: &InteractionEnvironment) -> bool
self and other values to be equal, and is used by ==.impl Copy for InteractionEnvironment
impl Eq for InteractionEnvironment
impl StructuralPartialEq for InteractionEnvironment
Auto Trait Implementations§
impl Freeze for InteractionEnvironment
impl RefUnwindSafe for InteractionEnvironment
impl Send for InteractionEnvironment
impl Sync for InteractionEnvironment
impl Unpin for InteractionEnvironment
impl UnsafeUnpin for InteractionEnvironment
impl UnwindSafe for InteractionEnvironment
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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.§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.§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.§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.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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