pub struct WidgetNodeId(/* private fields */);Expand description
A 128-bit identity for a widget.
Like NodeId, this is derived from a BLAKE3 hash, but it uses
the "widget:" prefix so that widget IDs and node IDs never collide. Widget IDs
are interconvertible with node IDs via From impls.
§Example
use fission_ir::WidgetNodeId;
let wid = WidgetNodeId::explicit("video-player");Implementations§
Source§impl WidgetNodeId
impl WidgetNodeId
Sourcepub const fn from_u128(val: u128) -> Self
pub const fn from_u128(val: u128) -> Self
Creates a WidgetNodeId from a raw 128-bit value.
Intended for internal use or deserialization.
Sourcepub fn explicit(name: &str) -> Self
pub fn explicit(name: &str) -> Self
Creates a WidgetNodeId from a user-provided name string.
The name is hashed with BLAKE3 (prefixed with "widget:"), producing a
deterministic ID. Use this to give stable identities to platform-embedded
widgets.
§Example
use fission_ir::WidgetNodeId;
let a = WidgetNodeId::explicit("camera-preview");
let b = WidgetNodeId::explicit("camera-preview");
assert_eq!(a, b);Trait Implementations§
Source§impl Clone for WidgetNodeId
impl Clone for WidgetNodeId
Source§fn clone(&self) -> WidgetNodeId
fn clone(&self) -> WidgetNodeId
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WidgetNodeId
impl Debug for WidgetNodeId
Source§impl<'de> Deserialize<'de> for WidgetNodeId
impl<'de> Deserialize<'de> for WidgetNodeId
Source§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
Source§impl From<NodeId> for WidgetNodeId
impl From<NodeId> for WidgetNodeId
Source§impl From<WidgetNodeId> for NodeId
impl From<WidgetNodeId> for NodeId
Source§fn from(id: WidgetNodeId) -> Self
fn from(id: WidgetNodeId) -> Self
Converts to this type from the input type.
Source§impl Hash for WidgetNodeId
impl Hash for WidgetNodeId
Source§impl Ord for WidgetNodeId
impl Ord for WidgetNodeId
Source§fn cmp(&self, other: &WidgetNodeId) -> Ordering
fn cmp(&self, other: &WidgetNodeId) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for WidgetNodeId
impl PartialEq for WidgetNodeId
Source§fn eq(&self, other: &WidgetNodeId) -> bool
fn eq(&self, other: &WidgetNodeId) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for WidgetNodeId
impl PartialOrd for WidgetNodeId
Source§impl Serialize for WidgetNodeId
impl Serialize for WidgetNodeId
impl Copy for WidgetNodeId
impl Eq for WidgetNodeId
impl StructuralPartialEq for WidgetNodeId
Auto Trait Implementations§
impl Freeze for WidgetNodeId
impl RefUnwindSafe for WidgetNodeId
impl Send for WidgetNodeId
impl Sync for WidgetNodeId
impl Unpin for WidgetNodeId
impl UnsafeUnpin for WidgetNodeId
impl UnwindSafe for WidgetNodeId
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