Struct accesskit::TreeUpdate [−][src]
Expand description
A serializable representation of an atomic change to a tree. The sender and receiver must be in sync; the update is only meant to bring the tree from a specific previous state into its next state. Trying to apply it to the wrong tree should immediately panic.
Fields
nodes: Vec<Node>An ordered list of zero or more node updates to apply to the tree.
Suppose that the next Node to be applied is node. The following
invariants must hold:
- Either:
node.idis already in the tree, or- the tree is empty, and
nodeis the new root of the tree.
- Every child ID in
node.childrenmust either be already a child of this node, or a new ID not previously in the tree. It is not allowed to “reparent” a child to this node without first removing that child from its previous parent. - When a new ID appears in
node.children, the tree should create a new uninitialized placeholder node for it immediately. That placeholder must be updated within the sameTreeUpdate, otherwise it’s a fatal error. This guarantees the tree is always complete before or after aTreeUpdate.
tree: Option<Tree>Rarely updated information about the tree as a whole. This may be omitted if it has not changed since the previous update, but providing the same information again is also allowed. This is required when initializing a tree.
focus: Option<NodeId>The node with keyboard focus within this tree, if any. If the focus is in a descendant tree, set this to the node to which that tree is anchored. The most recent focus, if any, must be provided with every tree update.
This field must contain a value if and only if the native host (e.g. window) currently has the keyboard focus. This implies that the AccessKit provider must track the native focus state and send matching tree updates. Rationale: A robust GUI toolkit must do this native focus tracking anyway in order to correctly render widgets (e.g. to draw or not draw a focus rectangle), so this focus tracking should not be duplicated between the toolkit and the AccessKit platform adapters.
Trait Implementations
Returns the “default value” for a type. Read more
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
Auto Trait Implementations
impl RefUnwindSafe for TreeUpdate
impl Send for TreeUpdate
impl Sync for TreeUpdate
impl Unpin for TreeUpdate
impl UnwindSafe for TreeUpdate
Blanket Implementations
Mutably borrows from an owned value. Read more