pub struct IgnoringErrorHandlerSafe;Expand description
A handler that silently ignores all errors that can never happen (e.g.:
! or Infallible).
§Examples
use std::convert::{Infallible, TryInto};
use dptree::di::DependencyMap;
use teloxide::error_handlers::{ErrorHandler, IgnoringErrorHandlerSafe};
let result: Result<String, Infallible> = "str".try_into();
match result {
Ok(string) => println!("{}", string),
Err(inf) => IgnoringErrorHandlerSafe::new().handle_error(inf, DependencyMap::new()).await,
}
IgnoringErrorHandlerSafe::new().handle_error(return, DependencyMap::new()).await;
// return type of `return` is `!` (aka never)ⓘ
use teloxide::{dptree::di::DependencyMap, error_handlers::{ErrorHandler, IgnoringErrorHandlerSafe}};
IgnoringErrorHandlerSafe::new().handle_error(0, DependencyMap::new());Implementations§
Trait Implementations§
Source§impl Clone for IgnoringErrorHandlerSafe
impl Clone for IgnoringErrorHandlerSafe
impl Copy for IgnoringErrorHandlerSafe
Source§impl ErrorHandler<!> for IgnoringErrorHandlerSafe
impl ErrorHandler<!> for IgnoringErrorHandlerSafe
Source§fn handle_error(
self: Arc<Self>,
_: Infallible,
_: DependencyMap,
) -> BoxFuture<'static, ()>
fn handle_error( self: Arc<Self>, _: Infallible, _: DependencyMap, ) -> BoxFuture<'static, ()>
Handles
error with the dependencies available at the point of failure. Read moreAuto Trait Implementations§
impl Forget for IgnoringErrorHandlerSafe
impl Freeze for IgnoringErrorHandlerSafe
impl Move for IgnoringErrorHandlerSafe
impl RefUnwindSafe for IgnoringErrorHandlerSafe
impl Send for IgnoringErrorHandlerSafe
impl Sync for IgnoringErrorHandlerSafe
impl Unpin for IgnoringErrorHandlerSafe
impl UnsafeUnpin for IgnoringErrorHandlerSafe
impl UnwindSafe for IgnoringErrorHandlerSafe
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Erasable for T
impl<T> Erasable for T
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more