MCPcopy Create free account
hub / github.com/Keats/validator / add

Method add

validator/src/types.rs:166–176  ·  view source on GitHub ↗
(&mut self, field: &'static str, error: ValidationError)

Source from the content-addressed store, hash-verified

164 }
165
166 pub fn add(&mut self, field: &'static str, error: ValidationError) {
167 if let ValidationErrorsKind::Field(ref mut vec) = self
168 .0
169 .entry(Cow::Borrowed(field))
170 .or_insert_with(|| ValidationErrorsKind::Field(vec![]))
171 {
172 vec.push(error);
173 } else {
174 panic!("Attempt to add field validation to a non-Field ValidationErrorsKind instance");
175 }
176 }
177
178 #[must_use]
179 pub fn is_empty(&self) -> bool {

Callers 1

validateMethod · 0.80

Calls

no outgoing calls

Tested by 1

validateMethod · 0.64