pub struct Ctxt {
errors: RefCell<Option<Vec<Error>>>,
}
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.
Fields§
§errors: RefCell<Option<Vec<Error>>>
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 check
ed.
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.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Ctxt
impl !RefUnwindSafe for Ctxt
impl Send for Ctxt
impl !Sync for Ctxt
impl Unpin for Ctxt
impl UnwindSafe for Ctxt
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