pub struct OneTimeCodeInput { /* private fields */ }Expand description
One sensitive editor presented as a bounded run of visual slots.
A slot accepts one Unicode grapheme. The slots are not fields: one
TextInput owns the focus, selection, composition, paste, and native text
actions for the entire control.
Implementations§
Source§impl OneTimeCodeInput
impl OneTimeCodeInput
pub fn new( ident: impl Into<Ident>, window: &mut Window, cx: &mut Context<'_, Self>, ) -> Self
Sourcepub fn name(self, name: impl Into<SharedString>) -> Self
pub fn name(self, name: impl Into<SharedString>) -> Self
Names the one native sensitive input when its visible label is outside this view.
Sourcepub fn text(self, text: impl Into<SharedString>) -> Self
pub fn text(self, text: impl Into<SharedString>) -> Self
Seeds the sensitive text without reporting a caller edit.
Sourcepub fn slots(self, slots: usize) -> Self
pub fn slots(self, slots: usize) -> Self
Chooses the visual/code length. Values outside 1 through 12 use the nearest bound so the control remains legible and finite.
pub fn invalid(self, invalid: bool) -> Self
pub fn required(self, required: bool) -> Self
pub fn read_only(self, read_only: bool) -> Self
pub fn value(&self, cx: &App) -> SharedString
pub fn len(&self, cx: &App) -> usize
pub fn is_empty(&self, cx: &App) -> bool
pub fn is_complete(&self, cx: &App) -> bool
pub fn slot_count(&self) -> usize
pub fn set_value( &mut self, value: impl Into<SharedString>, cx: &mut Context<'_, Self>, )
pub fn set_disabled(&mut self, disabled: bool, cx: &mut Context<'_, Self>)
pub fn set_read_only(&mut self, read_only: bool, cx: &mut Context<'_, Self>)
pub fn set_invalid(&mut self, invalid: bool, cx: &mut Context<'_, Self>)
Trait Implementations§
Source§impl Debug for OneTimeCodeInput
impl Debug for OneTimeCodeInput
Source§impl Disableable for OneTimeCodeInput
impl Disableable for OneTimeCodeInput
impl EventEmitter<OneTimeCodeInputEvent> for OneTimeCodeInput
Source§impl Focusable for OneTimeCodeInput
impl Focusable for OneTimeCodeInput
Source§fn focus_handle(&self, cx: &App) -> FocusHandle
fn focus_handle(&self, cx: &App) -> FocusHandle
Returns the focus handle associated with this view.
Source§impl Render for OneTimeCodeInput
impl Render for OneTimeCodeInput
Auto Trait Implementations§
impl !RefUnwindSafe for OneTimeCodeInput
impl !Send for OneTimeCodeInput
impl !Sync for OneTimeCodeInput
impl !UnwindSafe for OneTimeCodeInput
impl Freeze for OneTimeCodeInput
impl Unpin for OneTimeCodeInput
impl UnsafeUnpin for OneTimeCodeInput
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