pub struct TagInput { /* private fields */ }Expand description
A field that collects a set of short tokens.
A duplicate and a full field are refusals, shown where the typist is looking and with the typed text left in place, because a token the host will not take is not a token that silently vanished.
Implementations§
Source§impl TagInput
impl TagInput
pub fn new( ident: impl Into<Ident>, window: &mut Window, cx: &mut Context<'_, Self>, ) -> Self
pub fn placeholder(self, placeholder: impl Into<SharedString>) -> Self
Sourcepub fn max(self, max: usize) -> Self
pub fn max(self, max: usize) -> Self
How many tags the set may hold. Reaching it is reported as a refusal, not enforced by swallowing what was typed.
pub fn invalid(self, invalid: bool) -> Self
Replaces the set from the host side, which is how an addition or a removal actually takes effect.
pub fn set_disabled(&mut self, disabled: bool, cx: &mut Context<'_, Self>)
pub fn current(&self) -> &[SharedString]
pub fn field(&self) -> &Entity<TextInput>
Sourcepub fn targeted(&self) -> Option<&SharedString>
pub fn targeted(&self) -> Option<&SharedString>
The tag the next backspace would remove, if there is one.
Sourcepub fn refusal(&self) -> Option<&SharedString>
pub fn refusal(&self) -> Option<&SharedString>
What the control last refused, in the words it shows.
Trait Implementations§
impl EventEmitter<TagInputEvent> for TagInput
Source§impl Focusable for TagInput
impl Focusable for TagInput
Source§fn focus_handle(&self, _cx: &App) -> FocusHandle
fn focus_handle(&self, _cx: &App) -> FocusHandle
Returns the focus handle associated with this view.
Auto Trait Implementations§
impl !RefUnwindSafe for TagInput
impl !Send for TagInput
impl !Sync for TagInput
impl !UnwindSafe for TagInput
impl Freeze for TagInput
impl Unpin for TagInput
impl UnsafeUnpin for TagInput
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more