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) -> WidgetNodeId
pub const fn from_u128(val: u128) -> WidgetNodeId
Creates a WidgetNodeId from a raw 128-bit value.
Intended for internal use or deserialization.
Sourcepub fn explicit(name: &str) -> WidgetNodeId
pub fn explicit(name: &str) -> WidgetNodeId
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 · 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<WidgetNodeId, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<WidgetNodeId, <__D as Deserializer<'de>>::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§fn from(node: NodeId) -> WidgetNodeId
fn from(node: NodeId) -> WidgetNodeId
Converts to this type from the input type.
Source§impl From<WidgetNodeId> for NodeId
impl From<WidgetNodeId> for NodeId
Source§fn from(id: WidgetNodeId) -> NodeId
fn from(id: WidgetNodeId) -> NodeId
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 · 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§impl PartialOrd for WidgetNodeId
impl PartialOrd for WidgetNodeId
Source§impl Serialize for WidgetNodeId
impl Serialize for WidgetNodeId
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.