pub struct Label { /* private fields */ }Implementations§
Source§impl Label
impl Label
pub fn new(text: impl Into<Arc<str>>) -> Self
Sourcepub fn for_control(self, id: impl Into<ControlId>) -> Self
pub fn for_control(self, id: impl Into<ControlId>) -> Self
Binds this label to a logical form control id (similar to HTML label[for] / htmlFor).
When set, pointer activation on the label forwards to the registered control action and
requests focus for the control. This also enables aria-labelledby-like semantics when
the control uses the same ControlId.
Sourcepub fn test_id(self, test_id: impl Into<Arc<str>>) -> Self
pub fn test_id(self, test_id: impl Into<Arc<str>>) -> Self
Sets a stable test_id on the label root.
Sourcepub fn wrap_root(self, root: AnyElement) -> Self
pub fn wrap_root(self, root: AnyElement) -> Self
Wraps an arbitrary already-built subtree in this label’s association semantics.
This keeps the label’s accessible name and control forwarding behavior while letting higher layers own the visible layout/chrome subtree.
pub fn into_element<H: UiHost>( self, cx: &mut ElementContext<'_, H>, ) -> AnyElement
Trait Implementations§
Source§impl<H: UiHost> IntoUiElement<H> for Label
impl<H: UiHost> IntoUiElement<H> for Label
fn into_element(self, cx: &mut ElementContext<'_, H>) -> AnyElement
Source§impl UiPatchTarget for Label
impl UiPatchTarget for Label
Source§fn apply_ui_patch(self, _patch: UiPatch) -> Self
fn apply_ui_patch(self, _patch: UiPatch) -> Self
Applies an aggregated authoring patch (chrome + layout) and returns the refined value. Read more
Auto Trait Implementations§
impl Freeze for Label
impl !RefUnwindSafe for Label
impl !Send for Label
impl !Sync for Label
impl Unpin for Label
impl UnsafeUnpin for Label
impl !UnwindSafe for Label
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