Struct accesskit::TreeUpdate
source · [−]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.id
is already in the tree, or- the tree is empty, and
node
is the new root of the tree.
- Every child ID in
node.children
must 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
sourceimpl Clone for TreeUpdate
impl Clone for TreeUpdate
sourcefn clone(&self) -> TreeUpdate
fn clone(&self) -> TreeUpdate
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresourceimpl Debug for TreeUpdate
impl Debug for TreeUpdate
sourceimpl Default for TreeUpdate
impl Default for TreeUpdate
sourcefn default() -> TreeUpdate
fn default() -> TreeUpdate
sourceimpl<'de> Deserialize<'de> for TreeUpdate
impl<'de> Deserialize<'de> for TreeUpdate
sourcefn 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>,
sourceimpl<T: FnOnce() -> TreeUpdate> From<T> for TreeUpdate
impl<T: FnOnce() -> TreeUpdate> From<T> for TreeUpdate
sourceimpl JsonSchema for TreeUpdate
impl JsonSchema for TreeUpdate
sourcefn schema_name() -> String
fn schema_name() -> String
sourcefn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
sourcefn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref
keyword. Read more