pub struct OtpState { /* private fields */ }Expand description
State of an OTP input: the entered characters, the cursor and focus.
Implementations§
Source§impl OtpState
impl OtpState
Sourcepub fn set_code(&mut self, code: &str)
pub fn set_code(&mut self, code: &str)
Fills the cells from code, padding with blanks and dropping any
overflow.
Sourcepub fn with_length(cx: &mut App, length: usize) -> Self
pub fn with_length(cx: &mut App, length: usize) -> Self
length = number of cells (HeroUI default 4).
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Returns whether every cell is filled.
Sourcepub fn routed_errors(&self) -> &[SharedString]
pub fn routed_errors(&self) -> &[SharedString]
The server messages the form routed to this field, as last written by
the form’s validationErrors delivery — what this field’s error slot
renders. Empty once an accepted edit suppressed them or a reset hid
them.
Trait Implementations§
Source§impl Focusable for OtpState
impl Focusable for OtpState
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 OtpState
impl !UnwindSafe for OtpState
impl Freeze for OtpState
impl Send for OtpState
impl Sync for OtpState
impl Unpin for OtpState
impl UnsafeUnpin for OtpState
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
impl<T> ErasedDestructor for Twhere
T: 'static,
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