pub enum ValidationFeedback {
Pristine,
Valid,
Corrected {
message: LocalizedString,
since: Instant,
},
Invalid {
message: LocalizedString,
},
}Expand description
What composites render. Distinct from ValidationOutcome: the
outcome is the validator’s return value (no time concept); the
feedback adds a since instant so the visual layer can decay an
auto-correction announcement after a window without re-running the
validator.
Variants§
Pristine
No commit has happened yet, or the user is editing again after a previous outcome (typing always clears prior feedback).
Valid
Last commit returned ValidationOutcome::Valid. Composites
typically render this identically to Pristine — the
distinction matters for tests and for callers that want to
signal “yes, it’s confirmed valid” with a checkmark.
Corrected
Last commit returned ValidationOutcome::Corrected. since
is the wall-clock instant the correction was applied; composites
use it to decay the visual after corrected_pulse_duration_ms
from the theme.
Invalid
Last commit returned ValidationOutcome::Invalid. Persists
until the user edits again or an external Pristine reset.
Fields
message: LocalizedStringImplementations§
Source§impl ValidationFeedback
impl ValidationFeedback
Sourcepub fn is_invalid(&self) -> bool
pub fn is_invalid(&self) -> bool
Convenience: is this state currently signalling an error?
Sourcepub fn is_corrected(&self) -> bool
pub fn is_corrected(&self) -> bool
Convenience: was the last commit auto-corrected?
Trait Implementations§
Source§impl Clone for ValidationFeedback
impl Clone for ValidationFeedback
Source§fn clone(&self) -> ValidationFeedback
fn clone(&self) -> ValidationFeedback
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ValidationFeedback
impl Debug for ValidationFeedback
Source§impl Default for ValidationFeedback
impl Default for ValidationFeedback
Source§fn default() -> ValidationFeedback
fn default() -> ValidationFeedback
Source§impl PartialEq for ValidationFeedback
impl PartialEq for ValidationFeedback
Auto Trait Implementations§
impl !RefUnwindSafe for ValidationFeedback
impl !Send for ValidationFeedback
impl !Sync for ValidationFeedback
impl !UnwindSafe for ValidationFeedback
impl Freeze for ValidationFeedback
impl Unpin for ValidationFeedback
impl UnsafeUnpin for ValidationFeedback
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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