pub struct ErrorTree {
pub messages: Vec<String>,
pub children: HashMap<String, ErrorTree>,
}Expand description
ErrorTree
Fields§
§messages: Vec<String>errors at the current level
children: HashMap<String, ErrorTree>child errors indexed by field/key
Implementations§
Source§impl ErrorTree
impl ErrorTree
pub fn new() -> Self
pub fn collect<I>(iter: I) -> Result<(), Self>
pub fn add<M: ToString>(&mut self, message: M)
pub fn add_result<M: ToString>(&mut self, error: Result<(), M>)
pub fn addf(&mut self, args: Arguments<'_>)
pub fn add_for<K: ToString, M: ToString>(&mut self, key: K, message: M)
Sourcepub fn merge(&mut self, other: Self)
pub fn merge(&mut self, other: Self)
Merge another ErrorTree structure into this one. Child errors are merged recursively.
pub fn flatten_ref(&self) -> Vec<(String, String)>
Trait Implementations§
Source§impl CandidType for ErrorTree
impl CandidType for ErrorTree
Source§impl<'de> Deserialize<'de> for ErrorTree
impl<'de> Deserialize<'de> for ErrorTree
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for ErrorTree
impl StructuralPartialEq for ErrorTree
Auto Trait Implementations§
impl Freeze for ErrorTree
impl RefUnwindSafe for ErrorTree
impl Send for ErrorTree
impl Sync for ErrorTree
impl Unpin for ErrorTree
impl UnwindSafe for ErrorTree
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