Skip to main content

InteractionQuery

Trait InteractionQuery 

Source
pub trait InteractionQuery {
    // Required methods
    fn focus_target(&self) -> Option<SourceNodeId>;
    fn selection(&self) -> Option<Selection>;
    fn affordances_at(&self, point: Point) -> Vec<Affordance>;
    fn activation_target(&self, point: Point) -> Option<SourceNodeId>;
}
Expand description

Common-minimum interaction queries every lane publishes.

Required Methods§

Source

fn focus_target(&self) -> Option<SourceNodeId>

Current focused node, if any.

Source

fn selection(&self) -> Option<Selection>

Current selection (the active range across the lane’s source).

Source

fn affordances_at(&self, point: Point) -> Vec<Affordance>

Affordances at a point — what kinds of interaction the user can perform here (link, button, scrollable, editable, etc.). Returns multiple entries for stacked affordances (e.g., a link inside a scrollable region — both are reachable).

Source

fn activation_target(&self, point: Point) -> Option<SourceNodeId>

What gets activated when the user clicks at point. Distinct from affordances_at — affordances is “what’s possible”, activation_target is “what would happen on default-click.”

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§