Skip to main content

ScreenReader

Struct ScreenReader 

pub struct ScreenReader { /* private fields */ }

Implementations§

§

impl ScreenReader

pub fn new() -> ScreenReader

Speaks through the current host’s crate::host::SpeechFactory. Never panics: with no speech available this is a [NullSpeaker] and narration is silently dropped.

pub fn with_speaker(speaker: Box<dyn Speaker>) -> ScreenReader

pub fn null() -> ScreenReader

pub fn speaker(&self) -> &dyn Speaker

pub fn set_rate(&mut self, rate: f32)

Set the speech rate (1.0 = engine default; 2.0 ≈ twice as fast).

pub fn set_voice(&mut self, voice: &str)

Select a backend voice (e.g. an espeak-ng voice id like "en-us").

pub fn configure(&mut self, settings: &ScreenReaderSettings)

Speak at the rate and in the voice the person chose in Settings.

pub fn announce_focus(&mut self, node: &AccessNode)

Speaks describe of the newly-focused node, interrupting any previous narration — rapid arrow navigation speaks only the control landed on, never a backlog (see focus_storm test). Resets the reading cursor so the next read_next/read_prev re-anchors here.

pub fn announce( &mut self, text: impl Into<String>, priority: Priority, interrupt: bool, )

The live-region entry point: errors/permission prompts use Priority::Important (survives a focus interrupt); polite toasts use Priority::Notification.

pub fn announce_value_change(&mut self, value: impl Into<String>)

Interrupting — dragging a slider should track the latest value, not queue every intermediate one.

pub fn echo_char(&mut self, ch: char)

Spoken at Priority::Text, interrupting, so a fast typist’s echoes coalesce.

pub fn echo_word(&mut self, word: &str)

pub fn echo_deletion(&mut self, deleted: &str)

A single deleted character is spoken as “X deleted”; otherwise just “deleted”.

pub fn stop(&mut self)

The “silence key” (Orca convention): stop all speech and discard anything pending.

pub fn is_speaking(&self) -> bool

pub fn cursor_item<'a>( &mut self, order: &'a [ReadingItem], ) -> Option<&'a ReadingItem>

The item the cursor is on in order, which a double tap activates.

pub fn read_all(&mut self, root: &dyn Widget)

A “say all”: speaks every node’s describe as bulk Priority::Text (so a later focus change interrupts it). Seeds the reading cursor at the start.

pub fn read_all_in(&mut self, order: &[ReadingItem])

Self::read_all over order.

pub fn seed_reading_order(&mut self, root: &dyn Widget) -> usize

Refreshes the reading order without moving the cursor.

pub fn read_next(&mut self, root: &dyn Widget) -> Option<AccessNode>

Returns None (speaking nothing) at the end of the document.

pub fn read_next_in(&mut self, order: &[ReadingItem]) -> Option<AccessNode>

Self::read_next over order.

pub fn read_prev(&mut self, root: &dyn Widget) -> Option<AccessNode>

Returns None at the start of the document.

pub fn read_prev_in(&mut self, order: &[ReadingItem]) -> Option<AccessNode>

Self::read_prev over order.

pub fn explore_in( &mut self, order: &[ReadingItem], point: Point, ) -> Option<AccessNode>

Explore by touch: speak the item of order under point and put the cursor on it, pressing nothing. Of nested items the innermost wins (a key, not the keyboard around it). The item the cursor is already on is not spoken again, so a finger dragged across one key says it once. Returns the item when the cursor moved to it.

pub fn cursor(&self) -> Option<usize>

pub fn read_next_matching( &mut self, root: &dyn Widget, pred: impl Fn(&AccessNode) -> bool, ) -> Option<AccessNode>

Speaks a short “no more” cue and returns None when nothing ahead matches pred. Shared engine behind read_next_heading/read_next_control.

pub fn read_next_matching_in( &mut self, order: &[ReadingItem], pred: impl Fn(&AccessNode) -> bool, ) -> Option<AccessNode>

pub fn read_prev_matching( &mut self, root: &dyn Widget, pred: impl Fn(&AccessNode) -> bool, ) -> Option<AccessNode>

pub fn read_prev_matching_in( &mut self, order: &[ReadingItem], pred: impl Fn(&AccessNode) -> bool, ) -> Option<AccessNode>

pub fn read_next_heading(&mut self, root: &dyn Widget) -> Option<AccessNode>

Jump to the next heading and speak it (“Insert + H”).

pub fn read_prev_heading(&mut self, root: &dyn Widget) -> Option<AccessNode>

Jump to the previous heading and speak it (“Insert + Shift + H”).

pub fn read_next_control(&mut self, root: &dyn Widget) -> Option<AccessNode>

Jump to the next form field / interactive control and speak it (“Insert + F”).

pub fn read_prev_control(&mut self, root: &dyn Widget) -> Option<AccessNode>

Jump to the previous form field / interactive control and speak it (“Insert + Shift + F”).

Trait Implementations§

§

impl Default for ScreenReader

§

fn default() -> ScreenReader

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> AsAny for T
where T: 'static,

§

fn as_any(&self) -> &(dyn Any + 'static)

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Converts &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)

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSend for T
where T: Any + Send,

§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> NoneValue for T
where T: Default,

§

type NoneType = T

§

fn null_value() -> T

The none-equivalent value.
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

§

fn simd_from(_simd: S, value: T) -> T

§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

§

fn simd_into(self, simd: S) -> T

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> Fruit for T
where T: Send + Downcast,

§

impl<T> WasmNotSend for T
where T: Send,