pub struct Changeset { /* private fields */ }Implementations§
Source§impl Changeset
impl Changeset
pub fn from_map(input: Map<String, Value>) -> Self
pub fn from_value(value: Value) -> Self
pub fn required(&mut self, fields: &[&str]) -> &mut Self
pub fn string_length( &mut self, field: &str, min: Option<usize>, max: Option<usize>, ) -> &mut Self
pub fn string_contains( &mut self, field: &str, needle: &str, message: &str, ) -> &mut Self
pub fn inclusion( &mut self, field: &str, allowed: &[&str], message: &str, ) -> &mut Self
pub fn number_range( &mut self, field: &str, min: Option<f64>, max: Option<f64>, ) -> &mut Self
pub fn add_error( &mut self, field: impl Into<String>, code: impl Into<String>, message: impl Into<String>, ) -> &mut Self
pub fn is_valid(&self) -> bool
pub fn errors(&self) -> &[ValidationError]
pub fn errors_by_field(&self) -> BTreeMap<String, Vec<String>>
pub fn value(&self, field: &str) -> Option<&Value>
pub fn string(&self, field: &str) -> Option<&str>
pub fn number(&self, field: &str) -> Option<f64>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Changeset
impl RefUnwindSafe for Changeset
impl Send for Changeset
impl Sync for Changeset
impl Unpin for Changeset
impl UnsafeUnpin for Changeset
impl UnwindSafe for Changeset
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