Struct serde_derive_internals::Ctxt
source · pub struct Ctxt { /* private fields */ }Expand description
A type to collect errors together and format them.
Dropping this object will cause a panic. It must be consumed using check.
References can be shared since this type uses run-time exclusive mut checking.
Implementations§
source§impl Ctxt
impl Ctxt
sourcepub fn new() -> Self
pub fn new() -> Self
Create a new context object.
This object contains no errors, but will still trigger a panic if it is not checked.
sourcepub fn error_spanned_by<A: ToTokens, T: Display>(&self, obj: A, msg: T)
pub fn error_spanned_by<A: ToTokens, T: Display>(&self, obj: A, msg: T)
Add an error to the context object with a tokenenizable object.
The object is used for spanning in error messages.