pub struct CatchUnwindBuilder<Error = ResponseError> { /* private fields */ }
Expand description
The builder of CatchUnwind
middleware.
It’s Default
configuration tries to downcast the panic payload into String
or &str
, and
fallback to format it via std::fmt::Display
, as the error message.
The error code is set to ErrorCode::INTERNAL_ERROR
.
Implementations§
Source§impl<Error> CatchUnwindBuilder<Error>
impl<Error> CatchUnwindBuilder<Error>
Sourcepub fn new_with_handler(
handler: fn(method: &str, payload: Box<dyn Any + Send>) -> Error,
) -> Self
pub fn new_with_handler( handler: fn(method: &str, payload: Box<dyn Any + Send>) -> Error, ) -> Self
Create the builder of CatchUnwind
middleware with a custom handler converting panic
payloads into ResponseError
.
Trait Implementations§
Source§impl<Error: Clone> Clone for CatchUnwindBuilder<Error>
impl<Error: Clone> Clone for CatchUnwindBuilder<Error>
Source§fn clone(&self) -> CatchUnwindBuilder<Error>
fn clone(&self) -> CatchUnwindBuilder<Error>
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Default for CatchUnwindBuilder<ResponseError>
impl Default for CatchUnwindBuilder<ResponseError>
Source§impl<S: LspService> Layer<S> for CatchUnwindBuilder<S::Error>
impl<S: LspService> Layer<S> for CatchUnwindBuilder<S::Error>
Auto Trait Implementations§
impl<Error> Freeze for CatchUnwindBuilder<Error>
impl<Error> RefUnwindSafe for CatchUnwindBuilder<Error>
impl<Error> Send for CatchUnwindBuilder<Error>
impl<Error> Sync for CatchUnwindBuilder<Error>
impl<Error> Unpin for CatchUnwindBuilder<Error>
impl<Error> UnwindSafe for CatchUnwindBuilder<Error>
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