vizia_core 0.4.0

Core components of vizia
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::entity::Entity;
use accesskit::NodeId;
use vizia_id::GenerationalId;

/// Trait for converting between an [Entity] and an accesskit [NodeId].
pub trait IntoNode {
    /// Converts an [Entity] into the corresponding accesskit [NodeId].
    fn accesskit_id(&self) -> accesskit::NodeId;
}

impl IntoNode for Entity {
    /// Converts an [Entity] into the corresponding accesskit [NodeId].
    fn accesskit_id(&self) -> accesskit::NodeId {
        NodeId(self.index() as u64)
    }
}