Struct ScreenReader
pub struct ScreenReader { /* private fields */ }Implementations§
§impl ScreenReader
impl ScreenReader
pub fn new() -> 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)
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)
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)
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)
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,
)
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>)
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)
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)
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)
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 read_all(&mut self, root: &dyn Widget)
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 seed_reading_order(&mut self, root: &dyn Widget) -> usize
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>
pub fn read_next(&mut self, root: &dyn Widget) -> Option<AccessNode>
Returns None (speaking nothing) at the end of the document.
pub fn read_prev(&mut self, root: &dyn Widget) -> Option<AccessNode>
pub fn read_prev(&mut self, root: &dyn Widget) -> Option<AccessNode>
Returns None at the start of the document.
pub fn cursor(&self) -> Option<usize>
pub fn read_next_matching(
&mut self,
root: &dyn Widget,
pred: impl Fn(&AccessNode) -> bool,
) -> Option<AccessNode>
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_prev_matching( &mut self, root: &dyn Widget, pred: impl Fn(&AccessNode) -> bool, ) -> Option<AccessNode>
pub fn read_next_heading(&mut self, root: &dyn Widget) -> 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>
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>
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>
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
impl Default for ScreenReader
§fn default() -> ScreenReader
fn default() -> ScreenReader
Auto Trait Implementations§
impl Freeze for ScreenReader
impl !RefUnwindSafe for ScreenReader
impl Send for ScreenReader
impl !Sync for ScreenReader
impl Unpin for ScreenReader
impl UnsafeUnpin for ScreenReader
impl !UnwindSafe for ScreenReader
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<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> 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