Skip to main content

A11yBackend

Trait A11yBackend 

Source
pub trait A11yBackend: 'static {
    // Required methods
    fn window_event(&mut self, event: &dyn Any);
    fn pump(&mut self, world: &mut World);
    fn publish(&mut self, world: &mut World);
}
Expand description

The bridge between the ECS world and the platform accessibility API.

The world-side half (walking the tree, translating roles and states) runs as a system in crate::tick::TickStage::A11ySync and leaves a pending update behind; the three methods here are what a window backend calls to keep the platform in step with it. Assistive technologies deliver their requests on their own threads, so an implementation queues them and applies the queue in Self::pump, on the main thread, before the tick that reacts to them.

Required Methods§

Source

fn window_event(&mut self, event: &dyn Any)

Feed a platform window event to the bridge, before the window backend handles it. The event is the window backend’s own type; an implementation downcasts it and ignores what it does not know.

Source

fn pump(&mut self, world: &mut World)

Apply queued assistive-technology requests (focus, click, value changes, scroll-into-view) to the world.

Source

fn publish(&mut self, world: &mut World)

Publish the tree update the A11ySync stage built, if one is pending and an assistive technology is listening.

Implementors§