### Properties Methods Source: https://docs.rs/accesskit/latest/src/accesskit/lib.rs.html Methods for getting, setting, and clearing property values. ```APIDOC ## Properties Methods ### Description Provides methods for interacting with the properties of an accessibility node. ### Methods #### `get_mut` - **Signature**: `fn get_mut(&mut self, id: PropertyId, default: PropertyValue) -> &mut PropertyValue` - **Description**: Retrieves a mutable reference to a property value. If the property does not exist, it is created with the provided default value. - **Parameters**: - **id** (`PropertyId`) - The identifier of the property. - **default** (`PropertyValue`) - The default value to use if the property is not set. - **Returns**: `&mut PropertyValue` - A mutable reference to the property value. #### `set` - **Signature**: `fn set(&mut self, id: PropertyId, value: PropertyValue)` - **Description**: Sets a property to a specific value. If the property already exists, its value is updated; otherwise, it is added. - **Parameters**: - **id** (`PropertyId`) - The identifier of the property to set. - **value** (`PropertyValue`) - The value to set for the property. #### `clear` - **Signature**: `fn clear(&mut self, id: PropertyId)` - **Description**: Clears a specific property, resetting its value to `PropertyValue::None`. - **Parameters**: - **id** (`PropertyId`) - The identifier of the property to clear. ``` -------------------------------- ### Uuid Struct Overview Source: https://docs.rs/accesskit/latest/accesskit/struct.Uuid.html Provides an overview of the Uuid struct and its basic usage, including parsing and formatting examples. ```APIDOC ## Struct Uuid ### Description A Universally Unique Identifier (UUID). ### Examples **Parse and print URN:** ```rust let my_uuid = Uuid::parse_str("a1a2a3a4b1b2c1c2d1d2d3d4d5d6d7d8")?; println!("{}", my_uuid.urn()); ``` **Create and print random V4 UUID:** ```rust // Note that this requires the `v4` feature enabled in the uuid crate. let my_uuid = Uuid::new_v4(); println!("{}", my_uuid); ``` ### Formatting UUIDs can be formatted in several ways: - `simple`: `a1a2a3a4b1b2c1c2d1d2d3d4d5d6d7d8`. - `hyphenated`: `a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8`. - `urn`: `urn:uuid:A1A2A3A4-B1B2-C1C2-D1D2-D3D4D5D6D7D8`. - `braced`: `{a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8}`. **Default (hyphenated) formatting:** ```rust let my_uuid = Uuid::parse_str("a1a2a3a4b1b2c1c2d1d2d3d4d5d6d7d8")?; assert_eq!("a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8", my_uuid.to_string()); ``` **Custom formatting:** ```rust let my_uuid = Uuid::parse_str("a1a2a3a4b1b2c1c2d1d2d3d4d5d6d7d8")?; assert_eq!("urn:uuid:a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8", my_uuid.urn().to_string()); ``` ``` -------------------------------- ### Tree::new Constructor Source: https://docs.rs/accesskit/latest/accesskit/struct.Tree.html Creates a new Tree instance with a specified root node ID. No additional setup is required. ```rust pub fn new(root: NodeId) -> Tree ``` -------------------------------- ### Node Initialization and Basic Properties Source: https://docs.rs/accesskit/latest/src/accesskit/lib.rs.html Provides methods for creating a new node and accessing/modifying its role. ```APIDOC ## Node Initialization and Role Management ### Description Methods for creating a new `Node` and managing its `role` property. ### Methods #### `Node::new(role: Role) -> Self` Creates a new `Node` with the specified `Role` and default values for other properties. #### `Node::role(&self) -> Role` Returns the `Role` of the node. #### `Node::set_role(&mut self, value: Role)` Sets the `Role` of the node. ``` -------------------------------- ### Get Node Role Source: https://docs.rs/accesskit/latest/accesskit/struct.Node.html Retrieves the accessibility role of the node. ```rust pub fn role(&self) -> Role> ``` -------------------------------- ### Implement CloneToUninit for T Source: https://docs.rs/accesskit/latest/accesskit/enum.Invalid.html Nightly-only experimental API for copying data to uninitialized memory. Use with caution. ```rust unsafe fn clone_to_uninit(&self, dest: *mut u8) ``` -------------------------------- ### Get Maximum Y-coordinate Source: https://docs.rs/accesskit/latest/accesskit/struct.Rect.html Retrieves the maximum y-coordinate of the rectangle. ```rust pub fn max_y(&self) -> f64 ``` -------------------------------- ### Get Minimum Y-coordinate Source: https://docs.rs/accesskit/latest/accesskit/struct.Rect.html Retrieves the minimum y-coordinate of the rectangle. ```rust pub fn min_y(&self) -> f64 ``` -------------------------------- ### try_into Method Source: https://docs.rs/accesskit/latest/accesskit/enum.SortDirection.html Documentation for the `try_into` method used for performing conversions. ```APIDOC ## fn try_into(self) -> Result>::Error> ### Description Performs a conversion from type `T` to type `U`. This method returns a `Result` which is either the converted value of type `U` or an error if the conversion fails. The specific error type depends on the `TryFrom` implementation for `U`. ### Type Parameters - `T`: The source type of the value being converted. - `U`: The target type to convert into. ### Return Value - `Result>::Error>`: An `Ok` variant containing the converted value of type `U` on success, or an `Err` variant containing the conversion error on failure. ``` -------------------------------- ### Size::new Function Source: https://docs.rs/accesskit/latest/accesskit/struct.Size.html Creates a new Size instance with specified width and height. Use this to initialize a Size value. ```rust pub const fn new(width: f64, height: f64) -> Self ``` -------------------------------- ### Get Maximum X-coordinate Source: https://docs.rs/accesskit/latest/accesskit/struct.Rect.html Retrieves the maximum x-coordinate of the rectangle. ```rust pub fn max_x(&self) -> f64 ``` -------------------------------- ### Vec2 Constants and Constructors Source: https://docs.rs/accesskit/latest/src/accesskit/geometry.rs.html Provides constants and methods for creating and initializing Vec2 instances. ```APIDOC impl Vec2 { /// The vector (0, 0). pub const ZERO: Vec2 = Vec2::new(0., 0.); /// Create a new vector. #[inline] pub const fn new(x: f64, y: f64) -> Vec2 { Vec2 { x, y } } } ``` -------------------------------- ### Get Minimum X-coordinate Source: https://docs.rs/accesskit/latest/accesskit/struct.Rect.html Retrieves the minimum x-coordinate of the rectangle. ```rust pub fn min_x(&self) -> f64 ``` -------------------------------- ### Create a New Node Source: https://docs.rs/accesskit/latest/accesskit/struct.Node.html Initializes a new Node with a specified accessibility role. ```rust pub fn new(role: Role) -> Self> ``` -------------------------------- ### CloneToUninit Trait Implementation Source: https://docs.rs/accesskit/latest/accesskit/struct.Point.html Nightly-only experimental API for cloning to uninitialized memory. ```APIDOC ## impl CloneToUninit for T ### Description 🔬 This is a nightly-only experimental API. Performs copy-assignment from `self` to `dest`. ### Method `clone_to_uninit` ### Endpoint N/A (Trait Implementation) ### Parameters - **dest** (*mut u8) - Required - A mutable pointer to the destination memory. ### Request Body None ### Response None (This is an unsafe function that modifies memory directly) ### Response Example None ``` -------------------------------- ### Node Role Management Source: https://docs.rs/accesskit/latest/accesskit/struct.Node.html Methods for getting and setting the role of a Node. ```APIDOC ## impl Node ### pub fn role(&self) -> Role Returns the role of the node. ### pub fn set_role(&mut self, value: Role) Sets the role of the node. ``` -------------------------------- ### Get Rectangle Size Source: https://docs.rs/accesskit/latest/accesskit/struct.Rect.html Returns the size (width and height) of the rectangle. ```rust pub fn size(&self) -> Size ``` -------------------------------- ### Role Serialization Source: https://docs.rs/accesskit/latest/accesskit/enum.Role.html Demonstrates how to serialize a Role to a Serde serializer. ```APIDOC ## POST /serialize ### Description Serialize this value into the given Serde serializer. ### Method POST ### Endpoint /serialize ### Parameters #### Request Body - **__serializer** (Serializer) - Required - The Serde serializer to use. ### Response #### Success Response (200) - **Result** (Result) - The result of the serialization. ``` -------------------------------- ### Implement request_initial_tree Method Source: https://docs.rs/accesskit/latest/accesskit/trait.ActivationHandler.html Requests a TreeUpdate with a full accessibility tree. If the application can generate the tree synchronously, it should return the TreeUpdate. Otherwise, it must send the update asynchronously. This method may be called consecutively and must always generate a full tree update. ```rust fn request_initial_tree(&mut self) -> Option ``` -------------------------------- ### Node Role Accessors Source: https://docs.rs/accesskit/latest/src/accesskit/lib.rs.html Provides methods to get and set the role of a Node. ```rust impl Node { #[inline] pub fn role(&self) -> Role { self.role } #[inline] pub fn set_role(&mut self, value: Role) { self.role = value; } } ``` -------------------------------- ### Type ID Access Source: https://docs.rs/accesskit/latest/accesskit/struct.Affine.html Demonstrates how to get the `TypeId` of a type using the `Any` trait. ```APIDOC ## impl Any for T ### Description Provides runtime type information. #### fn type_id(&self) -> TypeId Gets the `TypeId` of `self`. ``` -------------------------------- ### Node Creation Source: https://docs.rs/accesskit/latest/accesskit/struct.Node.html Provides the method for creating a new Node instance. ```APIDOC ## impl Node ### pub fn new(role: Role) -> Self Creates a new Node with the specified role. ``` -------------------------------- ### Implementations for Live Source: https://docs.rs/accesskit/latest/accesskit/enum.Live.html Details the various trait implementations for the Live enum, including Clone, Debug, Deserialize, Hash, JsonSchema, PartialEq, Serialize, Copy, Eq, and others. ```APIDOC ## Implementations for Live ### `impl Clone for Live` Allows creating a copy of a `Live` enum variant. ### `impl Debug for Live` Enables debugging output for `Live` enum variants. ### `impl<'de> Deserialize<'de> for Live` Allows deserializing `Live` enum variants from formats like JSON. ### `impl Hash for Live` Enables hashing of `Live` enum variants for use in hash maps and sets. ### `impl JsonSchema for Live` Generates a JSON Schema for the `Live` enum. ### `impl PartialEq for Live` Allows comparison of `Live` enum variants for equality. ### `impl Serialize for Live` Enables serialization of `Live` enum variants into various formats. ### `impl Copy for Live` Indicates that `Live` enum variants can be copied implicitly. ### `impl Eq for Live` Marks `Live` enum variants as having a total equivalence relation. ``` -------------------------------- ### Node Bounds Management Source: https://docs.rs/accesskit/latest/accesskit/struct.Node.html APIs for getting, setting, and clearing the bounding box of a node. ```APIDOC ## GET /websites/rs_accesskit/Node/bounds ### Description Retrieves the bounding box of this node in its coordinate space. ### Method GET ### Endpoint /websites/rs_accesskit/Node/bounds ### Response #### Success Response (200) - **bounds** (Option) - The bounding box of the node. #### Response Example ```json { "bounds": { "x": 10, "y": 20, "width": 100, "height": 50 } } ``` ``` ```APIDOC ## POST /websites/rs_accesskit/Node/set_bounds ### Description Sets the bounding box of a node. ### Method POST ### Endpoint /websites/rs_accesskit/Node/set_bounds ### Parameters #### Request Body - **value** (Rect) - The new bounding box for the node. ### Request Example ```json { "value": { "x": 10, "y": 20, "width": 100, "height": 50 } } ``` ``` ```APIDOC ## POST /websites/rs_accesskit/Node/clear_bounds ### Description Clears the bounding box of a node. ### Method POST ### Endpoint /websites/rs_accesskit/Node/clear_bounds ``` -------------------------------- ### Create a New Node Source: https://docs.rs/accesskit/latest/src/accesskit/lib.rs.html Initializes a new Node with a specified role and default values for other properties. ```rust impl Node { #[inline] pub fn new(role: Role) -> Self { Self { role, ..Default::default() } } } ``` -------------------------------- ### Get Rectangle Height Source: https://docs.rs/accesskit/latest/accesskit/struct.Rect.html Calculates and returns the height of the rectangle. Note that the height can be negative. ```rust pub fn height(&self) -> f64 ``` -------------------------------- ### Affine Struct Overview Source: https://docs.rs/accesskit/latest/accesskit/struct.Affine.html Provides an overview of the Affine struct, its purpose as a 2D affine transform, and its derivation from the 'kurbo' crate. ```APIDOC ## Struct Affine ### Description A 2D affine transform. Derived from kurbo. ### Summary ```rust pub struct Affine(/* private fields */); ``` ``` -------------------------------- ### Get Rectangle Width Source: https://docs.rs/accesskit/latest/accesskit/struct.Rect.html Calculates and returns the width of the rectangle. Note that the width can be negative. ```rust pub fn width(&self) -> f64 ``` -------------------------------- ### Node Tree ID Management Source: https://docs.rs/accesskit/latest/accesskit/struct.Node.html APIs for getting, setting, and clearing the tree ID of a node. ```APIDOC ## GET /websites/rs_accesskit/Node/tree_id ### Description Retrieves the tree ID that this node grafts into. ### Method GET ### Endpoint /websites/rs_accesskit/Node/tree_id ### Response #### Success Response (200) - **tree_id** (Option) - The tree ID of the node. #### Response Example ```json { "tree_id": "tree-123" } ``` ``` ```APIDOC ## POST /websites/rs_accesskit/Node/set_tree_id ### Description Sets the tree ID for a node, making it a graft point. ### Method POST ### Endpoint /websites/rs_accesskit/Node/set_tree_id ### Parameters #### Request Body - **value** (TreeId) - The new tree ID for the node. ### Request Example ```json { "value": "tree-123" } ``` ``` ```APIDOC ## POST /websites/rs_accesskit/Node/clear_tree_id ### Description Clears the tree ID of a node, removing its subtree. ### Method POST ### Endpoint /websites/rs_accesskit/Node/clear_tree_id ``` -------------------------------- ### Affine Implementations Source: https://docs.rs/accesskit/latest/accesskit/struct.Affine.html Details the various implementations available for the Affine struct, including constants, constructors, and transformation methods. ```APIDOC ## Implementations ### impl Affine #### pub const IDENTITY: Affine The identity transform. #### pub const FLIP_Y: Affine A transform that is flipped on the y-axis. Useful for converting between y-up and y-down spaces. #### pub const FLIP_X: Affine A transform that is flipped on the x-axis. #### pub const fn new(c: [f64; 6]) -> Affine Construct an affine transform from coefficients. If the coefficients are `(a, b, c, d, e, f)`, then the resulting transformation represents this augmented matrix: ``` | a c e | | b d f | | 0 0 1 | ``` Note that this convention is transposed from PostScript and Direct2D, but is consistent with the Wikipedia formulation of affine transformation as augmented matrix. The idea is that `(A * B) * v == A * (B * v)`, where `*` is the `Mul` trait. #### pub const fn scale(s: f64) -> Affine An affine transform representing uniform scaling. #### pub const fn scale_non_uniform(s_x: f64, s_y: f64) -> Affine An affine transform representing non-uniform scaling with different scale values for x and y #### pub fn translate>(p: V) -> Affine An affine transform representing translation. #### pub fn map_unit_square(rect: Rect) -> Affine Creates an affine transformation that takes the unit square to the given rectangle. Useful when you want to draw into the unit square but have your output fill any rectangle. In this case push the `Affine` onto the transform stack. #### pub fn as_coeffs(self) -> [f64; 6] Get the coefficients of the transform. #### pub fn determinant(self) -> f64 Compute the determinant of this transform. #### pub fn inverse(self) -> Affine Compute the inverse transform. Produces NaN values when the determinant is zero. #### pub fn transform_rect_bbox(self, rect: Rect) -> Rect Compute the bounding box of a transformed rectangle. Returns the minimal `Rect` that encloses the given `Rect` after affine transformation. If the transform is axis-aligned, then this bounding box is “tight”, in other words the returned `Rect` is the transformed rectangle. The returned rectangle always has non-negative width and height. #### pub fn is_finite(&self) -> bool Is this map finite? #### pub fn is_nan(&self) -> bool Is this map NaN? ``` -------------------------------- ### Node Text Selection Management Source: https://docs.rs/accesskit/latest/accesskit/struct.Node.html APIs for getting, setting, and clearing the text selection of a node. ```APIDOC ## GET /websites/rs_accesskit/Node/text_selection ### Description Retrieves the text selection of this node. ### Method GET ### Endpoint /websites/rs_accesskit/Node/text_selection ### Response #### Success Response (200) - **text_selection** (Option<&TextSelection>) - The text selection of the node. #### Response Example ```json { "text_selection": { "start": 0, "end": 5 } } ``` ``` ```APIDOC ## POST /websites/rs_accesskit/Node/set_text_selection ### Description Sets the text selection of a node. ### Method POST ### Endpoint /websites/rs_accesskit/Node/set_text_selection ### Parameters #### Request Body - **value** (impl Into>) - The new text selection for the node. ### Request Example ```json { "value": { "start": 0, "end": 5 } } ``` ``` ```APIDOC ## POST /websites/rs_accesskit/Node/clear_text_selection ### Description Clears the text selection of a node. ### Method POST ### Endpoint /websites/rs_accesskit/Node/clear_text_selection ``` -------------------------------- ### Affine Creation Methods Source: https://docs.rs/accesskit/latest/src/accesskit/geometry.rs.html Methods for creating new Affine transformations, including from coefficients, scaling, and translation. ```APIDOC ## Affine Creation ### `new(c: [f64; 6]) -> Affine` Constructs an affine transform from coefficients. ### `scale(s: f64) -> Affine` Creates an affine transform representing uniform scaling. ### `scale_non_uniform(s_x: f64, s_y: f64) -> Affine` Creates an affine transform representing non-uniform scaling. ### `translate>(p: V) -> Affine` Creates an affine transform representing translation. ``` -------------------------------- ### TryFrom and TryInto Conversions Source: https://docs.rs/accesskit/latest/accesskit/struct.Affine.html Explains the `TryFrom` and `TryInto` traits for fallible type conversions. ```APIDOC ## impl TryFrom for T ### Description Provides a fallible conversion from one type to another. #### type Error = Infallible The type returned in the event of a conversion error. #### fn try_from(value: U) -> Result>::Error> Performs the conversion. ## impl TryInto for T ### Description Provides a fallible conversion from one type to another. #### type Error = >::Error The type returned in the event of a conversion error. #### fn try_into(self) -> Result>::Error> Performs the conversion. ``` -------------------------------- ### Get Uuid Version Number Source: https://docs.rs/accesskit/latest/accesskit/struct.Uuid.html Returns the version number of the UUID as a usize. This is a future-proof alternative to `get_version`. ```rust let my_uuid = Uuid::parse_str("02f09a3f-1624-3b1d-8409-44eff7708208")?; assert_eq!(3, my_uuid.get_version_num()); ``` -------------------------------- ### Size::ZERO Constant Source: https://docs.rs/accesskit/latest/accesskit/struct.Size.html Provides a Size with zero width and height. Use this for default or initial sizing. ```rust pub const ZERO: Size ``` -------------------------------- ### Get Rectangle Origin Source: https://docs.rs/accesskit/latest/accesskit/struct.Rect.html Returns the origin (top-left corner in y-down spaces with non-negative dimensions) of the rectangle. ```rust pub fn origin(&self) -> Point ``` -------------------------------- ### Generic Implementations for TextDecoration Source: https://docs.rs/accesskit/latest/accesskit/struct.TextDecoration.html Shows various blanket implementations for traits like Any, Borrow, CloneToUninit, DynClone, From, Into, ToOwned, TryFrom, and TryInto. ```rust impl Any for T where T: 'static + ?Sized, ``` ```rust impl Borrow for T where T: ?Sized, ``` ```rust impl BorrowMut for T where T: ?Sized, ``` ```rust impl CloneToUninit for T where T: Clone, ``` ```rust unsafe fn clone_to_uninit(&self, dest: *mut u8) ``` ```rust impl DynClone for T where T: Clone, ``` ```rust fn __clone_box(&self, _: Private) -> *mut () ``` ```rust impl From for T ``` ```rust fn from(t: T) -> T ``` ```rust impl Into for T where U: From, ``` ```rust fn into(self) -> U ``` ```rust impl ToOwned for T where T: Clone, ``` ```rust type Owned = T ``` ```rust fn to_owned(&self) -> T ``` ```rust fn clone_into(&self, target: &mut T) ``` ```rust impl TryFrom for T where U: Into, ``` ```rust type Error = Infallible ``` ```rust fn try_from(value: U) -> Result>::Error> ``` ```rust impl TryInto for T where U: TryFrom, ``` ```rust type Error = >::Error ``` ```rust fn try_into(self) -> Result>::Error> ``` ```rust impl DeserializeOwned for T where T: for<'de> Deserialize<'de>, ``` -------------------------------- ### Identity Affine Transform Source: https://docs.rs/accesskit/latest/accesskit/struct.Affine.html Represents the identity transform, which applies no changes. Useful as a starting point for transformations. ```rust pub const IDENTITY: Affine ``` -------------------------------- ### Create Rect from Origin and Size Source: https://docs.rs/accesskit/latest/accesskit/struct.Rect.html Initializes a Rect using an origin point and a size, guaranteeing non-negative dimensions. ```rust pub fn from_origin_size(origin: impl Into, size: impl Into) -> Rect ``` -------------------------------- ### Get Uuid Variant Source: https://docs.rs/accesskit/latest/accesskit/struct.Uuid.html Retrieves the variant of a Uuid. This method reads the variant byte and does not validate the rest of the UUID. ```rust let my_uuid = Uuid::parse_str("02f09a3f-1624-3b1d-8409-44eff7708208")?; assert_eq!(Variant::RFC4122, my_uuid.get_variant()); ``` -------------------------------- ### TryFrom and TryInto Implementations Source: https://docs.rs/accesskit/latest/accesskit/struct.Node.html Implementations of the TryFrom and TryInto traits for type conversions. ```APIDOC ### impl TryFrom for T #### Description Provides a way to attempt a conversion from type `U` into type `T`, returning a `Result`. #### Type Alias - **Error** (`>::Error`) - The type returned in the event of a conversion error. This is `Infallible` when `U` can always be converted into `T`. #### Method ##### fn try_from(value: U) -> Result>::Error> ###### Description Performs the conversion from `U` to `T`. ###### Parameters - **value** (U) - The value of type `U` to convert. ###### Response - **Result** - Ok(T) if the conversion is successful, Err(Error) otherwise. ``` ```APIDOC ### impl TryInto for T #### Description Provides a way to attempt a conversion from type `T` into type `U`, returning a `Result`. #### Type Alias - **Error** (`>::Error`) - The type returned in the event of a conversion error. #### Method ##### fn try_into(self) -> Result>::Error> ###### Description Performs the conversion from `T` to `U`. ###### Parameters - **self** (T) - The value of type `T` to convert. ###### Response - **Result** - Ok(U) if the conversion is successful, Err(Error) otherwise. ``` -------------------------------- ### Get Affine Transform Coefficients Source: https://docs.rs/accesskit/latest/accesskit/struct.Affine.html Retrieves the six coefficients that define the affine transform. These coefficients can be used for calculations or serialization. ```rust pub fn as_coeffs(self) -> [f64; 6] ``` -------------------------------- ### Affine Utility Methods Source: https://docs.rs/accesskit/latest/src/accesskit/geometry.rs.html Utility methods for Affine transformations, including retrieving coefficients and checking for finite values. ```APIDOC ## Affine Utility Methods ### `as_coeffs(self) -> [f64; 6]` Gets the coefficients of the transform. ### `is_finite(&self) -> bool` Checks if this map is finite. ``` -------------------------------- ### Get Absolute Value Rect Source: https://docs.rs/accesskit/latest/accesskit/struct.Rect.html Returns a new Rect with the absolute values of its width and height, ensuring non-negative dimensions. ```rust pub fn abs(&self) -> Rect ``` -------------------------------- ### Text Formatting Properties Source: https://docs.rs/accesskit/latest/accesskit/struct.Node.html Methods for managing foreground color and text decorations like overline, strikethrough, and underline. ```APIDOC ## Node Text Formatting API ### Description Provides methods to manage text formatting properties including foreground color and text decorations. ### Methods #### Foreground Color - `pub fn foreground_color(&self) -> Option`: Gets the foreground color. - `pub fn set_foreground_color(&mut self, value: Color)`: Sets the foreground color. - `pub fn clear_foreground_color(&mut self)`: Clears the foreground color. #### Overline - `pub fn overline(&self) -> Option`: Gets the overline text decoration. - `pub fn set_overline(&mut self, value: TextDecoration)`: Sets the overline text decoration. - `pub fn clear_overline(&mut self)`: Clears the overline text decoration. #### Strikethrough - `pub fn strikethrough(&self) -> Option`: Gets the strikethrough text decoration. - `pub fn set_strikethrough(&mut self, value: TextDecoration)`: Sets the strikethrough text decoration. - `pub fn clear_strikethrough(&mut self)`: Clears the strikethrough text decoration. #### Underline - `pub fn underline(&self) -> Option`: Gets the underline text decoration. - `pub fn set_underline(&mut self, value: TextDecoration)`: Sets the underline text decoration. - `pub fn clear_underline(&mut self)`: Clears the underline text decoration. ``` -------------------------------- ### String Property Methods Source: https://docs.rs/accesskit/latest/src/accesskit/lib.rs.html Methods for properties that are strings. ```APIDOC ## String Property Methods ### Description Methods for properties that are strings. ### Properties - `Label`: The label of a control. Supports setting and clearing. - `Description`: A description for the node. Supports setting and clearing. - `Value`: The value of the node. Supports setting and clearing. - `AccessKey`: A single character access key. Supports setting and clearing. - `AuthorId`: An author-defined unique identifier for automated testing. Supports setting and clearing. - `ClassName`: The class name of the node. Supports setting and clearing. - `FontFamily`: The font family of the node. Supports setting and clearing. - `HtmlTag`: The HTML tag associated with the node. Supports setting and clearing. ``` -------------------------------- ### Get UUID as a Byte Slice Source: https://docs.rs/accesskit/latest/accesskit/struct.Uuid.html Demonstrates borrowing the UUID's underlying 16-byte representation as a slice. This method does not consume the UUID. ```rust let bytes1 = [ 0xa1, 0xa2, 0xa3, 0xa4, 0xb1, 0xb2, 0xc1, 0xc2, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, ]; let uuid1 = Uuid::from_bytes_ref(&bytes1); let bytes2 = uuid1.as_bytes(); let uuid2 = Uuid::from_bytes_ref(bytes2); assert_eq!(uuid1, uuid2); assert!(std::ptr::eq( uuid2 as *const Uuid as *const u8, &bytes1 as *const [u8; 16] as *const u8, )); ``` -------------------------------- ### Implement PartialEq for TextDecorationStyle Source: https://docs.rs/accesskit/latest/accesskit/enum.TextDecorationStyle.html Enables comparison of TextDecorationStyle values for equality. This is fundamental for checking if two decoration styles are the same. ```rust fn eq(&self, other: &TextDecorationStyle) -> bool ``` ```rust fn ne(&self, other: &Rhs) -> bool ``` -------------------------------- ### String Property Methods Source: https://docs.rs/accesskit/latest/src/accesskit/lib.rs.html Defines methods for string-based node properties like label, description, and value. ```rust string_property_methods! { /// The label of a control that can have a label. If the label is specified /// via the [`Node::labelled_by`] relation, this doesn't need to be set. /// Note that the text content of a node with the [`Role::Label`] role /// should be provided via [`Node::value`], not this property. (Label, label, set_label, clear_label), (Description, description, set_description, clear_description), (Value, value, set_value, clear_value), /// A single character, usually part of this node's name, that can be pressed, /// possibly along with a platform-specific modifier, to perform /// this node's default action. For menu items, the access key is only active /// while the menu is active, in contrast with [`keyboard_shortcut`]; /// a single menu item may in fact have both properties. /// /// [`keyboard_shortcut`]: Node::keyboard_shortcut (AccessKey, access_key, set_access_key, clear_access_key), /// A way for application authors to identify this node for automated /// testing purpose. The value must be unique among this node's siblings. (AuthorId, author_id, set_author_id, clear_author_id), (ClassName, class_name, set_class_name, clear_class_name), /// Only present when different from parent. (FontFamily, font_family, set_font_family, clear_font_family), (HtmlTag, html_tag, set_html_tag, clear_html_tag) } ``` -------------------------------- ### Get Uuid Fields Source: https://docs.rs/accesskit/latest/accesskit/struct.Uuid.html Returns the four field values of a Uuid as a tuple. These can be used to reconstruct the Uuid using `Uuid::from_fields`. ```rust let uuid = Uuid::nil(); assert_eq!(uuid.as_fields(), (0, 0, 0, &[0u8; 8])); let uuid = Uuid::parse_str("a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8")?; assert_eq!( uuid.as_fields(), ( 0xa1a2a3a4, 0xb1b2, 0xc1c2, &[0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8], ) ); ``` -------------------------------- ### Generic Blanket Implementations for Any Type Source: https://docs.rs/accesskit/latest/accesskit/enum.Orientation.html These blanket implementations apply to any type T and provide generic functionality such as getting the TypeId, borrowing, and cloning. ```rust impl Any for T where T: 'static + ?Sized, ``` ```rust fn type_id(&self) -> TypeId ``` ```rust impl Borrow for T where T: ?Sized, ``` ```rust fn borrow(&self) -> &T ``` ```rust impl BorrowMut for T where T: ?Sized, ``` ```rust fn borrow_mut(&mut self) -> &mut T ``` ```rust impl CloneToUninit for T where T: Clone, ``` ```rust unsafe fn clone_to_uninit(&self, dest: *mut u8) ``` ```rust impl DynClone for T where T: Clone, ``` ```rust fn __clone_box(&self, _: Private) -> *mut () ``` ```rust impl From for T ``` ```rust fn from(t: T) -> T ``` ```rust impl Into for T where U: From, ``` ```rust fn into(self) -> U ``` ```rust impl ToOwned for T where T: Clone, ``` ```rust type Owned = T ``` ```rust fn to_owned(&self) -> T ``` ```rust fn clone_into(&self, target: &mut T) ``` ```rust impl TryFrom for T where U: Into, ``` ```rust type Error = Infallible ``` ```rust fn try_from(value: U) -> Result>::Error> ``` ```rust impl TryInto for T where U: TryFrom, ``` ```rust type Error = >::Error ``` ```rust fn try_into(self) -> Result>::Error> ``` -------------------------------- ### Rect::from_origin_size Constructor Source: https://docs.rs/accesskit/latest/src/accesskit/geometry.rs.html Creates a new Rect from an origin point and a size, ensuring non-negative width and height. ```rust pub fn from_origin_size(origin: impl Into, size: impl Into) -> Rect { let origin = origin.into(); Rect::from_points(origin, origin + size.into().to_vec2()) } ``` -------------------------------- ### Character and Word Boundary Information Source: https://docs.rs/accesskit/latest/accesskit/struct.Node.html Methods for managing character lengths, word start indices, and character positions within text runs. ```APIDOC ## Node Text Geometry API ### Description Provides methods to manage detailed information about text runs, including character lengths, word boundaries, and character positions. ### Methods #### Character Lengths - `pub fn character_lengths(&self) -> &[u8]`: Gets the length of each character in UTF-8 code units (bytes) for text runs. - `pub fn set_character_lengths(&mut self, value: impl Into>)`: Sets the character lengths for text runs. - `pub fn clear_character_lengths(&mut self)`: Clears the character lengths. #### Word Starts - `pub fn word_starts(&self) -> &[u8]`: Gets the start index of each word in characters for text runs. - `pub fn set_word_starts(&mut self, value: impl Into>)`: Sets the word start indices for text runs. - `pub fn clear_word_starts(&mut self)`: Clears the word start indices. #### Character Positions - `pub fn character_positions(&self) -> Option<&[f32]>`: Gets the position of each character within the node's bounding box. - `pub fn set_character_positions(&mut self, value: impl Into>)`: Sets the character positions for text runs. - `pub fn clear_character_positions(&mut self)`: Clears the character positions. ``` -------------------------------- ### Initialize New Tree with Root ID Source: https://docs.rs/accesskit/latest/src/accesskit/lib.rs.html Tests the initialization of a new accessibility tree with a specified root node ID. Verifies that the root ID, toolkit name, and toolkit version are set correctly. ```rust let tree = Tree::new(NodeId(1)); assert_eq!(tree.root, NodeId(1)); assert_eq!(tree.toolkit_name, None); assert_eq!(tree.toolkit_version, None); ``` -------------------------------- ### Color Property Methods Tests Source: https://docs.rs/accesskit/latest/src/accesskit/lib.rs.html Tests for setting, getting, and clearing color properties on a Node. Ensures that color values are correctly updated and reset. ```rust fn getter_should_return_default_value() { let node = Node::new(Role::Unknown); assert!(node.$getter().is_none()); } ``` ```rust fn setter_should_update_the_property() { let mut node = Node::new(Role::Unknown); node.$setter(Color { red: 255, green: 255, blue: 255, alpha: 255 }); assert_eq!(node.$getter(), Some(Color { red: 255, green: 255, blue: 255, alpha: 255 })); } ``` ```rust fn clearer_should_reset_the_property() { let mut node = Node::new(Role::Unknown); node.$setter(Color { red: 255, green: 255, blue: 255, alpha: 255 }); node.$clearer(); assert!(node.$getter().is_none()); } ``` -------------------------------- ### Implement PartialEq for Color Source: https://docs.rs/accesskit/latest/accesskit/struct.Color.html Enables equality comparison between Color instances. Supports both equality (`==`) and inequality (`!=`) checks. ```rust fn eq(&self, other: &Color) -> bool ``` ```rust fn ne(&self, other: &Rhs) -> bool ``` -------------------------------- ### Default for Size Trait Implementation Source: https://docs.rs/accesskit/latest/accesskit/struct.Size.html Provides a default Size value, typically zero width and height. Use `Size::default()` to get this value. ```rust fn default() -> Size ``` -------------------------------- ### Create New Point Source: https://docs.rs/accesskit/latest/accesskit/struct.Point.html Constructs a new Point instance with specified x and y coordinates. ```rust pub const fn new(x: f64, y: f64) -> Self ``` -------------------------------- ### Text Decoration Property Methods Tests Source: https://docs.rs/accesskit/latest/src/accesskit/lib.rs.html Tests for setting, getting, and clearing text decoration properties on a Node. Verifies correct handling of TextDecoration values. ```rust const TEST_TEXT_DECORATION: TextDecoration = TextDecoration { style: TextDecorationStyle::Dotted, color: Color { red: 0, green: 0, blue: 0, alpha: 255, }, }; ``` ```rust fn getter_should_return_default_value() { let node = Node::new(Role::Unknown); assert!(node.$getter().is_none()); } ``` ```rust fn setter_should_update_the_property() { let mut node = Node::new(Role::Unknown); node.$setter(TEST_TEXT_DECORATION); assert_eq!(node.$getter(), Some(TEST_TEXT_DECORATION)); } ``` ```rust fn clearer_should_reset_the_property() { let mut node = Node::new(Role::Unknown); node.$setter(TEST_TEXT_DECORATION); node.$clearer(); assert!(node.$getter().is_none()); } ``` -------------------------------- ### Role Deserialization Source: https://docs.rs/accesskit/latest/accesskit/enum.Role.html Demonstrates how to deserialize a Role from a Serde deserializer. ```APIDOC ## POST /deserialize ### Description Deserialize this value from the given Serde deserializer. ### Method POST ### Endpoint /deserialize ### Parameters #### Request Body - **__deserializer** (Deserializer) - Required - The Serde deserializer to use. ### Response #### Success Response (200) - **Result** (Result) - The deserialized Role or an error. ### Response Example ```json { "Ok": { "role_value": "some_role" } } ``` ``` -------------------------------- ### From and Into Implementations for Generic Types Source: https://docs.rs/accesskit/latest/accesskit/enum.TextAlign.html Enables conversion between types using `From` and `Into`. `From` allows creating a `T` from a `U`, while `Into` allows converting a `T` into a `U` if `U` implements `From`. ```rust impl From for T ``` ```rust fn from(t: T) -> T ``` ```rust impl Into for T where U: From, ``` ```rust fn into(self) -> U ``` -------------------------------- ### Get Uuid Version Source: https://docs.rs/accesskit/latest/accesskit/struct.Uuid.html Returns the version of the UUID as an Option. Returns None if the version field is not recognized. Use `get_version_num` for unconditional numeric retrieval. ```rust let my_uuid = Uuid::parse_str("02f09a3f-1624-3b1d-8409-44eff7708208")?; assert_eq!(Some(Version::Md5), my_uuid.get_version()); ``` -------------------------------- ### Implement From for u8 Source: https://docs.rs/accesskit/latest/accesskit/enum.AutoComplete.html Enables conversion from an `AutoComplete` enum variant into a `u8` value. This is the inverse of `TryFrom` and is used to get the underlying byte representation of the enum. ```rust impl From for u8 { fn from(value: AutoComplete) -> Self { // ... implementation details ... } } ``` -------------------------------- ### Copy, Eq, and StructuralPartialEq for Action Source: https://docs.rs/accesskit/latest/accesskit/enum.Action.html Information about the Copy, Eq, and StructuralPartialEq trait implementations for the Action enum. ```APIDOC ### impl Copy for Action ### Description This trait indicates that the type can be copied by simply copying its bits. This is a marker trait. ### impl Eq for Action ### Description This trait indicates that the type implements `PartialEq` and that equality is reflexive, symmetric, and transitive. ### impl StructuralPartialEq for Action ### Description This trait is automatically implemented for types that are structurally comparable. It is a marker trait. ``` -------------------------------- ### Define Basic Property Methods Source: https://docs.rs/accesskit/latest/src/accesskit/lib.rs.html Generates getter, setter, and clearer methods for a property. Used internally by other macros. ```rust macro_rules! property_methods { ($($(#[$doc:meta])* ($id:ident, $getter:ident, $type_getter:ident, $setter_param:ty, $setter:ident, $type_setter:ident, $pusher_param:ty, $pusher:ident, $clearer:ident)),+) => { $(property_methods! { @$id $(#[$doc])* ($getter, $type_getter, $setter_param, $setter, $type_setter, $pusher_param, $pusher, $clearer) })+ }; (@$id:ident $(#[$doc:meta])* ($getter:ident, $type_getter:ident, $setter_param:ty, $setter:ident, $type_setter:ident, $pusher_param:ty, $pusher:ident, $clearer:ident)) => { $(#[$doc])* #[inline] pub fn $getter(&self) -> $type_getter { self.properties.get($id) } $(#[$doc])* #[inline] pub fn $setter(&mut self, value: $setter_param) { self.$type_setter($id, value); } $(#[$doc])* #[inline] pub fn $pusher(&mut self, value: $pusher_param) { self.$pusher($id, value); } $(#[$doc])* #[inline] pub fn $clearer(&mut self) { self.properties.clear($id); } }; } ``` -------------------------------- ### Option Reference Type Getters Macro Source: https://docs.rs/accesskit/latest/src/accesskit/lib.rs.html Generates getter methods for properties that return an Option reference type. Examples include Affine, String, CoordSlice, and TextSelection. ```rust option_ref_type_getters! { (get_affine_property, Affine, Affine), (get_string_property, str, String), (get_coord_slice_property, [f32], CoordSlice), (get_text_selection_property, TextSelection, TextSelection) } ``` -------------------------------- ### Length Slice Property Methods Tests Source: https://docs.rs/accesskit/latest/src/accesskit/lib.rs.html Tests for setting, getting, and clearing length slice properties (byte slices) on a Node. Ensures empty slices are handled correctly. ```rust fn getter_should_return_default_value() { let node = Node::new(Role::Unknown); assert!(node.$getter().is_empty()); } ``` ```rust fn setter_should_update_the_property() { let mut node = Node::new(Role::Unknown); node.$setter([]); assert!(node.$getter().is_empty()); ``` -------------------------------- ### New Node Role Initialization Source: https://docs.rs/accesskit/latest/src/accesskit/lib.rs.html Tests that a newly created node is initialized with the specified role. This ensures the correct role is set upon node creation. ```rust let node = Node::new(Role::Button); assert_eq!(node.role(), Role::Button); ``` -------------------------------- ### Convert UUID to Little-Endian Bytes Source: https://docs.rs/accesskit/latest/accesskit/struct.Uuid.html Returns the UUID's bytes in little-endian order, with each field's bytes reversed. Compatible with Microsoft's mixed-endian GUID format. ```rust use uuid::Uuid; let uuid = Uuid::parse_str("a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8")?; assert_eq!( uuid.to_bytes_le(), ([0xa4, 0xa3, 0xa2, 0xa1, 0xb2, 0xb1, 0xc2, 0xc1, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8]) ); ``` -------------------------------- ### Implement do_action Method Source: https://docs.rs/accesskit/latest/accesskit/trait.ActionHandler.html Implement the do_action method to perform requested actions. If an action is unsupported, the method should do nothing. Consider asynchronous handling for better performance. ```rust fn do_action(&mut self, request: ActionRequest) ```