atspi_common/
action.rs

1use serde::{Deserialize, Serialize};
2use zvariant::Type;
3
4/// An action which may be triggered through the accessibility API.
5#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Type)]
6pub struct Action {
7	/// The name of the action
8	pub name: String,
9	/// Description of the action
10	pub description: String,
11	// TODO: should be an enum/stricter type; this is why it's in its own file.
12	/// The keybinding(s) used to trigger it (without the AT).
13	pub keybinding: String,
14}
15
16#[cfg(test)]
17mod test {
18	use super::Action;
19	use zbus_lockstep::method_return_signature;
20	use zvariant::Type;
21	#[test]
22	fn validate_action_signature() {
23		// signature is of type `a(sss)`, where `(sss)` is the type we're validating.
24		let action_signature =
25			method_return_signature!(member: "GetActions", interface: "org.a11y.atspi.Action");
26		assert_eq!(Vec::<Action>::SIGNATURE, &action_signature);
27	}
28}