#[non_exhaustive]pub struct BackendCaps {
pub reports_cancel: bool,
pub reports_pressure: bool,
pub reports_tilt: bool,
pub reports_twist: bool,
pub reports_pen_kind: bool,
pub reports_palm: bool,
pub reports_scroll_phase: bool,
pub reports_os_momentum: bool,
pub reports_os_pinch: bool,
pub synthesises_mouse_from_touch: bool,
pub touch_window_drag: bool,
pub osk: SoftKeyboardSupport,
}Expand description
What a backend can actually report.
Every field is a platform fact established by reading the backend, not an
aspiration. The per-OS matrix and its citations are in
docs/touch-and-pen.md, “Platform capabilities”; the machine-readable
version is BackendCaps::for_platform.
#[non_exhaustive]: construct one with
for_platform and adjust, so a later capability
cannot break a call site.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.reports_cancel: boolThe backend reports a cancel distinct from a lift. When false, a
revoked contact arrives as an ordinary Ended (or as nothing at all)
and the framework has to infer revocation from focus loss.
reports_pressure: boolContacts carry a tip pressure.
reports_tilt: boolStylus tilt is reported.
reports_twist: boolStylus barrel rotation is reported.
reports_pen_kind: boolThe backend distinguishes a pen tip from an eraser.
reports_palm: boolThe backend flags a contact the digitizer classified as a palm.
reports_scroll_phase: boolScroll samples carry a begin/change/end structure rather than being bare notches.
reports_os_momentum: boolThe OS produces the momentum (inertial) part of a scroll itself, so the framework must not add a fling of its own on top.
reports_os_pinch: boolThe OS recognises pinch/rotate on the trackpad and hands over the result.
synthesises_mouse_from_touch: boolThe OS also synthesises a mouse stream from touch, so the translator must suppress one of the two.
touch_window_drag: boolA finger can start an OS window move/resize.
osk: SoftKeyboardSupportHow the on-screen keyboard can be reached.
Implementations§
Source§impl BackendCaps
impl BackendCaps
Sourcepub const fn for_platform(
platform: PlatformKind,
window_system: WindowSystem,
) -> Self
pub const fn for_platform( platform: PlatformKind, window_system: WindowSystem, ) -> Self
The capability row for one platform, and — on Unix — one window system.
window_system is ignored off Unix: WindowSystem only ever resolves
to Wayland or X11 from a live Linux/BSD display handle, and
WindowSystem::Unknown is precisely the set {Windows, macOS,
headless}. That is what makes Unknown a safe default for the
mouse-promotion suppressors — none of those three platforms promote.
Every value here is cited in docs/touch-and-pen.md.
Trait Implementations§
Source§impl Clone for BackendCaps
impl Clone for BackendCaps
Source§fn clone(&self) -> BackendCaps
fn clone(&self) -> BackendCaps
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 BackendCaps
Source§impl Debug for BackendCaps
impl Debug for BackendCaps
Source§impl Default for BackendCaps
impl Default for BackendCaps
Source§fn default() -> BackendCaps
fn default() -> BackendCaps
impl Eq for BackendCaps
Source§impl Hash for BackendCaps
impl Hash for BackendCaps
Source§impl PartialEq for BackendCaps
impl PartialEq for BackendCaps
impl StructuralPartialEq for BackendCaps
Auto Trait Implementations§
impl Freeze for BackendCaps
impl RefUnwindSafe for BackendCaps
impl Send for BackendCaps
impl Sync for BackendCaps
impl Unpin for BackendCaps
impl UnsafeUnpin for BackendCaps
impl UnwindSafe for BackendCaps
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§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.