pub struct FormField<'a, 'f, Errors: EguiValidationReport> { /* private fields */ }
Expand description
A form field that can be validated.
Will color the field red (using the color from egui::style::Visuals::error_fg_color
) if there is an error.
Will show the error message below the field if the field is blurred and there is an error.
Implementations§
Source§impl<'a, 'f, Errors: EguiValidationReport> FormField<'a, 'f, Errors>
impl<'a, 'f, Errors: EguiValidationReport> FormField<'a, 'f, Errors>
Sourcepub fn new<'c, I: IntoFieldPath<Errors::FieldPath<'c>>>(
form: &'f mut Form<Errors>,
into_field_path: I,
) -> Self
pub fn new<'c, I: IntoFieldPath<Errors::FieldPath<'c>>>( form: &'f mut Form<Errors>, into_field_path: I, ) -> Self
Create a new FormField
.
Pass a Form and a reference to the field you want to validate.
If you use crate::garde
, just pass the field name / path as a string.
If you use crate::validator
, pass a field reference using the [crate::field_path
] macro.
Auto Trait Implementations§
impl<'a, 'f, Errors> Freeze for FormField<'a, 'f, Errors>
impl<'a, 'f, Errors> RefUnwindSafe for FormField<'a, 'f, Errors>where
Errors: RefUnwindSafe,
impl<'a, 'f, Errors> Send for FormField<'a, 'f, Errors>where
Errors: Send,
impl<'a, 'f, Errors> Sync for FormField<'a, 'f, Errors>where
Errors: Sync,
impl<'a, 'f, Errors> Unpin for FormField<'a, 'f, Errors>
impl<'a, 'f, Errors> !UnwindSafe for FormField<'a, 'f, Errors>
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