pub struct UseId {
pub value: Signal<String>,
}Expand description
A stable, unique identifier for one mounted component.
The identifier is generated once, on the first render, and never
changes afterwards: every re-render at the same hook index returns
the same UseId, and the value it carries is the same string.
The value is shaped <prefix>-<counter>, where counter is a
process-wide monotonically increasing number. The prefix lets a
caller keep the identifiers of different kinds apart in the DOM
(field-1, field-2, panel-1), which is what makes them
readable in devtools and in accessibility audits.
§Arguments
&'static str- The prefix put in front of the counter.
Fields§
§value: Signal<String>The generated identifier.
Defaults to Signal::create(String::default()) via
#[new(skip)]; the hook fills it with the generated value
immediately afterwards.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for UseId
impl RefUnwindSafe for UseId
impl Send for UseId
impl Sync for UseId
impl Unpin for UseId
impl UnsafeUnpin for UseId
impl UnwindSafe for UseId
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