pub struct LinuxProvider { /* private fields */ }Expand description
Linux accessibility provider using AT-SPI2 over D-Bus.
Implementations§
Trait Implementations§
Source§impl Provider for LinuxProvider
impl Provider for LinuxProvider
Source§fn list_shell_surfaces(&self) -> Result<Vec<(ShellSurfaceKind, ElementData)>>
fn list_shell_surfaces(&self) -> Result<Vec<(ShellSurfaceKind, ElementData)>>
Enumerate desktop panels and docks.
A Linux shell surface is a top-level AT-SPI frame whose attribute set
carries window-type:dock — how panels self-identify, from
xfce4-panel’s panel and dock rows to GNOME’s and KDE’s shells. One
surface per such frame, so a panel process that owns two rows yields
two ShellSurfaceKind::Panel entries, each with the panel process’s
pid. Panels are commonly unnamed; the frame’s name is then None and
the core falls back to the kind.
Panel is the only kind Linux vends: the desktop has no menu bar,
taskbar, or dock object of its own, and StatusNotifierItem menus live
on com.canonical.dbusmenu, a different subsystem from AT-SPI. Their
absence from the listing is honest scope, not failure.
The scan runs over list_apps rather than its own
registry walk, so it inherits that enumeration’s empty-name filter: a
panel that registers on the bus without a name is invisible here for
the same reason it is invisible to App::list.
§Errors
A top-level that was just enumerated but will not answer GetRole or
GetAttributes fails the listing (tenet 1). Those two calls are how a
frame is classified, and Panel is the only kind Linux vends — so
treating a D-Bus failure as “not a panel” turns one broken process into
an empty listing that reads exactly like a desktop with no panels. The
error names the app and object path that would not answer.
An object that answers GetAttributes with UnknownMethod is the one
exception, and it is absence rather than failure — see the call site.
Enumerating one app’s top-levels is the one step that still skips:
get_atspi_children failing is how a
process that has left the bus presents, and focused_app already
treats it that way.
Source§fn list_apps(&self) -> Result<Vec<ElementData>>
fn list_apps(&self) -> Result<Vec<ElementData>>
Enumerate top-level applications by listing direct children of the
AT-SPI registry root — every running accessibility-enabled app
registers a child accessible there. Apps with empty names are
filtered out (toolkits sometimes register transient/system
accessibles before the real app appears). PID resolution uses the
AT-SPI Application interface, falling back to the D-Bus owner.
Source§fn app_by_pid(&self, pid: u32) -> Result<ElementData>
fn app_by_pid(&self, pid: u32) -> Result<ElementData>
Find an application by pid directly against the AT-SPI registry.
Differs from filtering list_apps() in two ways that matter for a
freshly launched process:
- No empty-name filter — toolkits can register on the bus before the app name is set, and a pid match is precise enough on its own.
- The not-matched error reports how many registry entries were
examined and how many had no resolvable pid (the misreported-pid
bridge quirk
get_app_piddocuments), so a timeout on CI says why the app was invisible instead of just “not found”.
Source§fn focused_app(&self) -> Result<ElementData>
fn focused_app(&self) -> Result<ElementData>
Identify the foreground application via the active top-level window.
AT-SPI has no registry-level “focused application” call, and the
Application accessibles themselves don’t carry an active/focused
state across toolkits. The portable signal is the ACTIVE state
(AtspiStateType::ACTIVE) set on the foreground window (frame): we
enumerate each registered application’s top-level children and return
the first application that owns a window reporting ACTIVE.
Returns Error::SelectorNotMatched when no window is active (no app
has the foreground — e.g. focus is on the shell or a non-AT-SPI
surface). The core reads that as “nothing focused”, not a failure.
Source§fn get_children(
&self,
element: Option<&ElementData>,
) -> Result<Vec<ElementData>>
fn get_children( &self, element: Option<&ElementData>, ) -> Result<Vec<ElementData>>
Source§fn find_elements_group(
&self,
root: &ElementData,
group: &SelectorGroup,
limit: Option<usize>,
max_depth: Option<u32>,
) -> Result<Vec<ElementData>>
fn find_elements_group( &self, root: &ElementData, group: &SelectorGroup, limit: Option<usize>, max_depth: Option<u32>, ) -> Result<Vec<ElementData>>
root’s subtree. Read moreSource§fn get_parent(&self, element: &ElementData) -> Result<Option<ElementData>>
fn get_parent(&self, element: &ElementData) -> Result<Option<ElementData>>
Source§fn select(&self, element: &ElementData) -> Result<()>
fn select(&self, element: &ElementData) -> Result<()>
Source§fn expand(&self, element: &ElementData) -> Result<()>
fn expand(&self, element: &ElementData) -> Result<()>
Source§fn increment(&self, element: &ElementData) -> Result<()>
fn increment(&self, element: &ElementData) -> Result<()>
Source§fn decrement(&self, element: &ElementData) -> Result<()>
fn decrement(&self, element: &ElementData) -> Result<()>
Source§fn scroll_into_view(&self, element: &ElementData) -> Result<()>
fn scroll_into_view(&self, element: &ElementData) -> Result<()>
Source§fn set_value(&self, element: &ElementData, value: &str) -> Result<()>
fn set_value(&self, element: &ElementData, value: &str) -> Result<()>
Source§fn set_numeric_value(&self, element: &ElementData, value: f64) -> Result<()>
fn set_numeric_value(&self, element: &ElementData, value: f64) -> Result<()>
Source§fn type_text(&self, element: &ElementData, text: &str) -> Result<()>
fn type_text(&self, element: &ElementData, text: &str) -> Result<()>
Source§fn set_text_selection(
&self,
element: &ElementData,
start: u32,
end: u32,
) -> Result<()>
fn set_text_selection( &self, element: &ElementData, start: u32, end: u32, ) -> Result<()>
Source§fn perform_action(&self, element: &ElementData, action: &str) -> Result<()>
fn perform_action(&self, element: &ElementData, action: &str) -> Result<()>
snake_case name. Read moreSource§fn subscribe(&self, element: &ElementData) -> Result<Subscription>
fn subscribe(&self, element: &ElementData) -> Result<Subscription>
Source§fn find_elements(
&self,
root: &ElementData,
selector: &Selector,
limit: Option<usize>,
max_depth: Option<u32>,
) -> Result<Vec<ElementData>, Error>
fn find_elements( &self, root: &ElementData, selector: &Selector, limit: Option<usize>, max_depth: Option<u32>, ) -> Result<Vec<ElementData>, Error>
Source§fn narrow_multi_segment(
&self,
candidates: Vec<ElementData>,
segments: &[SelectorSegment],
max_depth: u32,
limit: Option<usize>,
) -> Result<Vec<ElementData>, Error>
fn narrow_multi_segment( &self, candidates: Vec<ElementData>, segments: &[SelectorSegment], max_depth: u32, limit: Option<usize>, ) -> Result<Vec<ElementData>, Error>
Auto Trait Implementations§
impl !Freeze for LinuxProvider
impl !RefUnwindSafe for LinuxProvider
impl !UnwindSafe for LinuxProvider
impl Send for LinuxProvider
impl Sync for LinuxProvider
impl Unpin for LinuxProvider
impl UnsafeUnpin for LinuxProvider
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
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<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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 moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.