pub struct NodeId(/* private fields */);Expand description
A lightweight, interned identifier for nodes in the scene graph.
Internally a Spur index — 4 bytes, Copy, Eq, Hash in O(1).
Implementations§
Source§impl NodeId
impl NodeId
Sourcepub fn intern(s: &str) -> Self
pub fn intern(s: &str) -> Self
Intern a new string as a NodeId, or return existing if already interned.
Sourcepub fn anonymous(kind: &str) -> Self
pub fn anonymous(kind: &str) -> Self
Generate a unique anonymous ID (for nodes without explicit @id).
Uses the node kind as prefix: _rect_0, _text_1, _group_2, etc.
Sourcepub fn with_prefix(prefix: &str) -> Self
pub fn with_prefix(prefix: &str) -> Self
Generate a unique ID with a type prefix (e.g. rect_1, ellipse_2).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for NodeId
impl<'de> Deserialize<'de> for NodeId
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl Copy for NodeId
impl Eq for NodeId
impl StructuralPartialEq for NodeId
Auto Trait Implementations§
impl Freeze for NodeId
impl RefUnwindSafe for NodeId
impl Send for NodeId
impl Sync for NodeId
impl Unpin for NodeId
impl UnsafeUnpin for NodeId
impl UnwindSafe for NodeId
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.