pub struct ValidationContext { /* private fields */ }Expand description
Context for validation with source location lookup.
This context is populated from ConfigValues during config building and
made available to validation code via thread-local storage. This enables
validation errors to include accurate source locations without changing
the Validate trait signature.
Implementations§
Source§impl ValidationContext
impl ValidationContext
Sourcepub fn new(locations: SourceLocationMap) -> Self
pub fn new(locations: SourceLocationMap) -> Self
Create a new validation context with the given source locations.
Sourcepub fn location_for(&self, path: &str) -> Option<&SourceLocation>
pub fn location_for(&self, path: &str) -> Option<&SourceLocation>
Look up the source location for a config path.
Trait Implementations§
Source§impl Debug for ValidationContext
impl Debug for ValidationContext
Source§impl Default for ValidationContext
impl Default for ValidationContext
Source§fn default() -> ValidationContext
fn default() -> ValidationContext
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ValidationContext
impl RefUnwindSafe for ValidationContext
impl Send for ValidationContext
impl Sync for ValidationContext
impl Unpin for ValidationContext
impl UnsafeUnpin for ValidationContext
impl UnwindSafe for ValidationContext
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