pub struct State<'a> {
pub path_arr: &'a [PathPart],
pub key: &'a str,
pub value: &'a Value,
pub node: &'a Node,
pub parent_is_array: bool,
pub is_match: bool,
pub ctx: &'a mut Context,
pub absent: bool,
pub check_name: &'a str,
/* private fields */
}Expand description
What a custom validator sees: where it is, what it is looking at.
Fields§
§path_arr: &'a [PathPart]The path from the root, the current key last: array indices as indices, keys as keys.
key: &'a strThe immediate key or index.
value: &'a ValueThe value under validation.
node: &'a NodeThe node of the value.
parent_is_array: boolWhether the parent is an array (an index) or an object (a property).
is_match: boolTrue on a matches or valid call: nothing is produced.
ctx: &'a mut Context§absent: boolThe value is missing, rather than present and null.
check_name: &'a strThe name of the validator running, for check "<name>" failed.
Implementations§
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for State<'a>
impl<'a> !UnwindSafe for State<'a>
impl<'a> Freeze for State<'a>
impl<'a> Send for State<'a>
impl<'a> Sync for State<'a>
impl<'a> Unpin for State<'a>
impl<'a> UnsafeUnpin for State<'a>
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