Struct accesskit::NodeClassSet
source · pub struct NodeClassSet(/* private fields */);
Expand description
Allows nodes that have the same role, actions, and set of defined properties
to share metadata. Each node has a class which is created by NodeBuilder
,
and when NodeBuilder::build
is called, the node’s class is added
to the provided instance of this struct if an identical class isn’t
in that set already. Once a class is added to a class set, it currently
remains in that set for the life of that set, whether or not any nodes
are still using the class.
It’s not an error for different nodes in the same tree, or even subsequent versions of the same node, to be built from different class sets; it’s merely suboptimal.
Note: This struct’s Default
implementation doesn’t provide access to
a shared set, as one might assume; it creates a new set. For a shared set,
use NodeClassSet::lock_global
.
Implementations§
source§impl NodeClassSet
impl NodeClassSet
pub fn new() -> Self
sourcepub fn lock_global() -> impl DerefMut<Target = Self>
pub fn lock_global() -> impl DerefMut<Target = Self>
Accesses a shared class set guarded by a mutex.
Trait Implementations§
source§impl Clone for NodeClassSet
impl Clone for NodeClassSet
source§fn clone(&self) -> NodeClassSet
fn clone(&self) -> NodeClassSet
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more