pub struct FieldValidationError {
pub field: Option<&'static str>,
pub message: String,
}Expand description
One validation failure attached to a project-driven validate
call on ModelAdmin. Either targets a specific field (rendered
inline next to its input) or surfaces globally in the form’s
error banner.
Plain owned struct — Send + Sync so a Vec<FieldValidationError>
can cross await points freely.
Fields§
§field: Option<&'static str>Some(name) routes the error to the matching field on the
form (rendered next to that input with the existing inline-
error styling). None lands the message in the form-level
banner — appropriate for cross-field rules (“end date must
not be before start date” could attach to either, but a
“this booking conflicts with another one” message has no
single owning field).
message: StringUser-facing message, one sentence. Should not include the field’s own label — the renderer adds it.
Implementations§
Trait Implementations§
Source§impl Clone for FieldValidationError
impl Clone for FieldValidationError
Source§fn clone(&self) -> FieldValidationError
fn clone(&self) -> FieldValidationError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for FieldValidationError
impl RefUnwindSafe for FieldValidationError
impl Send for FieldValidationError
impl Sync for FieldValidationError
impl Unpin for FieldValidationError
impl UnsafeUnpin for FieldValidationError
impl UnwindSafe for FieldValidationError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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