pub struct WidgetId(/* private fields */);Expand description
Identifies one node in the widget tree.
The id stays valid for as long as the node lives and is never reused for a different node, so an id whose node was removed refers to nothing. Every operation that takes one reports that rather than acting on another node.
Implementations§
Source§impl WidgetId
impl WidgetId
Sourcepub fn as_u64(self) -> u64
pub fn as_u64(self) -> u64
Returns the raw representation of the id.
An accessibility backend identifies its nodes by u64, so the
projection maps ids through this conversion. The raw value of two
live ids is always different, and a value this tree never handed out
restores to an id that names no node.
Sourcepub fn from_u64(raw: u64) -> WidgetId
pub fn from_u64(raw: u64) -> WidgetId
Restores the id that WidgetId::as_u64 encoded.
An id whose node was removed already, or one that names no node at all, is a no-op everywhere the tree takes it.
Trait Implementations§
impl Copy for WidgetId
impl Eq for WidgetId
Source§impl Key for WidgetId
impl Key for WidgetId
Source§fn null() -> Self
fn null() -> Self
Creates a new key that is always invalid and distinct from any non-null
key. A null key can only be created through this method (or default
initialization of keys made with
new_key_type!, which calls this
method). Read moreSource§impl Ord for WidgetId
impl Ord for WidgetId
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
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for WidgetId
impl PartialOrd for WidgetId
impl StructuralPartialEq for WidgetId
Auto Trait Implementations§
impl Forget for WidgetId
impl Freeze for WidgetId
impl Move for WidgetId
impl RefUnwindSafe for WidgetId
impl Send for WidgetId
impl Sync for WidgetId
impl Unpin for WidgetId
impl UnsafeUnpin for WidgetId
impl UnwindSafe for WidgetId
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