pub struct CheckContext { /* private fields */ }Expand description
Explicit warning sink threaded through a single validation pass.
The context is stack-local: it is created per entry-point call and dropped afterwards, so warnings cannot leak between calls. The optional current object id is stamped onto entries that do not already carry one.
Implementations§
Source§impl CheckContext
impl CheckContext
Sourcepub fn set_object_id(&mut self, object_id: Option<String>) -> Option<String>
pub fn set_object_id(&mut self, object_id: Option<String>) -> Option<String>
Sets the current object id, returning the previous value.
Sourcepub fn warn(&mut self, entry: Entry)
pub fn warn(&mut self, entry: Entry)
Records a warning, stamping the current object id when the entry has none.
Entries are deduplicated by (object_id, kind, property, value) so a
repeated rule cannot produce duplicate findings.
Sourcepub fn into_warnings(self) -> Vec<Entry>
pub fn into_warnings(self) -> Vec<Entry>
Consumes the context and returns its warnings.
Trait Implementations§
Source§impl Clone for CheckContext
impl Clone for CheckContext
Source§impl Debug for CheckContext
impl Debug for CheckContext
Auto Trait Implementations§
impl Forget for CheckContext
impl Freeze for CheckContext
impl Move for CheckContext
impl RefUnwindSafe for CheckContext
impl Send for CheckContext
impl Sync for CheckContext
impl Unpin for CheckContext
impl UnsafeUnpin for CheckContext
impl UnwindSafe for CheckContext
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