pub trait TryFromInput: Send + Sized {
type Error: Error + Send;
// Required method
fn try_from_input(
input: HandlerInput,
) -> impl Future<Output = Result<Option<Self>, Self::Error>> + Send;
}
Expand description
Allows to create a specific handler input.
Required Associated Types§
Required Methods§
Sourcefn try_from_input(
input: HandlerInput,
) -> impl Future<Output = Result<Option<Self>, Self::Error>> + Send
fn try_from_input( input: HandlerInput, ) -> impl Future<Output = Result<Option<Self>, Self::Error>> + Send
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl TryFromInput for ()
impl TryFromInput for ()
type Error = Infallible
async fn try_from_input( _input: HandlerInput, ) -> Result<Option<Self>, Self::Error>
Source§impl<A> TryFromInput for (A,)where
A: TryFromInput,
A::Error: 'static,
impl<A> TryFromInput for (A,)where
A: TryFromInput,
A::Error: 'static,
type Error = ConvertInputError
async fn try_from_input( input: HandlerInput, ) -> Result<Option<Self>, Self::Error>
Source§impl<A, B> TryFromInput for (A, B)
impl<A, B> TryFromInput for (A, B)
type Error = ConvertInputError
async fn try_from_input( input: HandlerInput, ) -> Result<Option<Self>, Self::Error>
Source§impl<A, B, C> TryFromInput for (A, B, C)where
A: TryFromInput,
A::Error: 'static,
B: TryFromInput,
B::Error: 'static,
C: TryFromInput,
C::Error: 'static,
impl<A, B, C> TryFromInput for (A, B, C)where
A: TryFromInput,
A::Error: 'static,
B: TryFromInput,
B::Error: 'static,
C: TryFromInput,
C::Error: 'static,
type Error = ConvertInputError
async fn try_from_input( input: HandlerInput, ) -> Result<Option<Self>, Self::Error>
Source§impl<A, B, C, D> TryFromInput for (A, B, C, D)where
A: TryFromInput,
A::Error: 'static,
B: TryFromInput,
B::Error: 'static,
C: TryFromInput,
C::Error: 'static,
D: TryFromInput,
D::Error: 'static,
impl<A, B, C, D> TryFromInput for (A, B, C, D)where
A: TryFromInput,
A::Error: 'static,
B: TryFromInput,
B::Error: 'static,
C: TryFromInput,
C::Error: 'static,
D: TryFromInput,
D::Error: 'static,
type Error = ConvertInputError
async fn try_from_input( input: HandlerInput, ) -> Result<Option<Self>, Self::Error>
Source§impl<A, B, C, D, E> TryFromInput for (A, B, C, D, E)where
A: TryFromInput,
A::Error: 'static,
B: TryFromInput,
B::Error: 'static,
C: TryFromInput,
C::Error: 'static,
D: TryFromInput,
D::Error: 'static,
E: TryFromInput,
E::Error: 'static,
impl<A, B, C, D, E> TryFromInput for (A, B, C, D, E)where
A: TryFromInput,
A::Error: 'static,
B: TryFromInput,
B::Error: 'static,
C: TryFromInput,
C::Error: 'static,
D: TryFromInput,
D::Error: 'static,
E: TryFromInput,
E::Error: 'static,
type Error = ConvertInputError
async fn try_from_input( input: HandlerInput, ) -> Result<Option<Self>, Self::Error>
Source§impl<A, B, C, D, E, F> TryFromInput for (A, B, C, D, E, F)where
A: TryFromInput,
A::Error: 'static,
B: TryFromInput,
B::Error: 'static,
C: TryFromInput,
C::Error: 'static,
D: TryFromInput,
D::Error: 'static,
E: TryFromInput,
E::Error: 'static,
F: TryFromInput,
F::Error: 'static,
impl<A, B, C, D, E, F> TryFromInput for (A, B, C, D, E, F)where
A: TryFromInput,
A::Error: 'static,
B: TryFromInput,
B::Error: 'static,
C: TryFromInput,
C::Error: 'static,
D: TryFromInput,
D::Error: 'static,
E: TryFromInput,
E::Error: 'static,
F: TryFromInput,
F::Error: 'static,
type Error = ConvertInputError
async fn try_from_input( input: HandlerInput, ) -> Result<Option<Self>, Self::Error>
Source§impl<A, B, C, D, E, F, G> TryFromInput for (A, B, C, D, E, F, G)where
A: TryFromInput,
A::Error: 'static,
B: TryFromInput,
B::Error: 'static,
C: TryFromInput,
C::Error: 'static,
D: TryFromInput,
D::Error: 'static,
E: TryFromInput,
E::Error: 'static,
F: TryFromInput,
F::Error: 'static,
G: TryFromInput,
G::Error: 'static,
impl<A, B, C, D, E, F, G> TryFromInput for (A, B, C, D, E, F, G)where
A: TryFromInput,
A::Error: 'static,
B: TryFromInput,
B::Error: 'static,
C: TryFromInput,
C::Error: 'static,
D: TryFromInput,
D::Error: 'static,
E: TryFromInput,
E::Error: 'static,
F: TryFromInput,
F::Error: 'static,
G: TryFromInput,
G::Error: 'static,
type Error = ConvertInputError
async fn try_from_input( input: HandlerInput, ) -> Result<Option<Self>, Self::Error>
Source§impl<A, B, C, D, E, F, G, H> TryFromInput for (A, B, C, D, E, F, G, H)where
A: TryFromInput,
A::Error: 'static,
B: TryFromInput,
B::Error: 'static,
C: TryFromInput,
C::Error: 'static,
D: TryFromInput,
D::Error: 'static,
E: TryFromInput,
E::Error: 'static,
F: TryFromInput,
F::Error: 'static,
G: TryFromInput,
G::Error: 'static,
H: TryFromInput,
H::Error: 'static,
impl<A, B, C, D, E, F, G, H> TryFromInput for (A, B, C, D, E, F, G, H)where
A: TryFromInput,
A::Error: 'static,
B: TryFromInput,
B::Error: 'static,
C: TryFromInput,
C::Error: 'static,
D: TryFromInput,
D::Error: 'static,
E: TryFromInput,
E::Error: 'static,
F: TryFromInput,
F::Error: 'static,
G: TryFromInput,
G::Error: 'static,
H: TryFromInput,
H::Error: 'static,
type Error = ConvertInputError
async fn try_from_input( input: HandlerInput, ) -> Result<Option<Self>, Self::Error>
Source§impl<A, B, C, D, E, F, G, H, I> TryFromInput for (A, B, C, D, E, F, G, H, I)where
A: TryFromInput,
A::Error: 'static,
B: TryFromInput,
B::Error: 'static,
C: TryFromInput,
C::Error: 'static,
D: TryFromInput,
D::Error: 'static,
E: TryFromInput,
E::Error: 'static,
F: TryFromInput,
F::Error: 'static,
G: TryFromInput,
G::Error: 'static,
H: TryFromInput,
H::Error: 'static,
I: TryFromInput,
I::Error: 'static,
impl<A, B, C, D, E, F, G, H, I> TryFromInput for (A, B, C, D, E, F, G, H, I)where
A: TryFromInput,
A::Error: 'static,
B: TryFromInput,
B::Error: 'static,
C: TryFromInput,
C::Error: 'static,
D: TryFromInput,
D::Error: 'static,
E: TryFromInput,
E::Error: 'static,
F: TryFromInput,
F::Error: 'static,
G: TryFromInput,
G::Error: 'static,
H: TryFromInput,
H::Error: 'static,
I: TryFromInput,
I::Error: 'static,
type Error = ConvertInputError
async fn try_from_input( input: HandlerInput, ) -> Result<Option<Self>, Self::Error>
Source§impl<A, B, C, D, E, F, G, H, I, J> TryFromInput for (A, B, C, D, E, F, G, H, I, J)where
A: TryFromInput,
A::Error: 'static,
B: TryFromInput,
B::Error: 'static,
C: TryFromInput,
C::Error: 'static,
D: TryFromInput,
D::Error: 'static,
E: TryFromInput,
E::Error: 'static,
F: TryFromInput,
F::Error: 'static,
G: TryFromInput,
G::Error: 'static,
H: TryFromInput,
H::Error: 'static,
I: TryFromInput,
I::Error: 'static,
J: TryFromInput,
J::Error: 'static,
impl<A, B, C, D, E, F, G, H, I, J> TryFromInput for (A, B, C, D, E, F, G, H, I, J)where
A: TryFromInput,
A::Error: 'static,
B: TryFromInput,
B::Error: 'static,
C: TryFromInput,
C::Error: 'static,
D: TryFromInput,
D::Error: 'static,
E: TryFromInput,
E::Error: 'static,
F: TryFromInput,
F::Error: 'static,
G: TryFromInput,
G::Error: 'static,
H: TryFromInput,
H::Error: 'static,
I: TryFromInput,
I::Error: 'static,
J: TryFromInput,
J::Error: 'static,
type Error = ConvertInputError
async fn try_from_input( input: HandlerInput, ) -> Result<Option<Self>, Self::Error>
Implementors§
Source§impl TryFromInput for Chat
impl TryFromInput for Chat
type Error = Infallible
Source§impl TryFromInput for Poll
impl TryFromInput for Poll
type Error = Infallible
Source§impl TryFromInput for KeyChat
Available on crate feature ratelimit
only.
impl TryFromInput for KeyChat
Available on crate feature
ratelimit
only.type Error = Infallible
Source§impl TryFromInput for KeyChatUser
Available on crate feature ratelimit
only.
impl TryFromInput for KeyChatUser
Available on crate feature
ratelimit
only.type Error = Infallible
Source§impl TryFromInput for KeyUser
Available on crate feature ratelimit
only.
impl TryFromInput for KeyUser
Available on crate feature
ratelimit
only.type Error = Infallible
Source§impl TryFromInput for SessionId
Available on crate feature session
only.
impl TryFromInput for SessionId
Available on crate feature
session
only.type Error = Infallible
Source§impl TryFromInput for HandlerInput
impl TryFromInput for HandlerInput
type Error = Infallible
Source§impl TryFromInput for CallbackQuery
impl TryFromInput for CallbackQuery
type Error = Infallible
Source§impl TryFromInput for ChatJoinRequest
impl TryFromInput for ChatJoinRequest
type Error = Infallible
Source§impl TryFromInput for ChatMemberUpdated
impl TryFromInput for ChatMemberUpdated
type Error = Infallible
Source§impl TryFromInput for ChatPeerId
impl TryFromInput for ChatPeerId
type Error = Infallible
Source§impl TryFromInput for ChatUsername
impl TryFromInput for ChatUsername
type Error = Infallible
Source§impl TryFromInput for ChosenInlineResult
impl TryFromInput for ChosenInlineResult
type Error = Infallible
Source§impl TryFromInput for Command
impl TryFromInput for Command
type Error = CommandError
Source§impl TryFromInput for InlineQuery
impl TryFromInput for InlineQuery
type Error = Infallible
Source§impl TryFromInput for Message
impl TryFromInput for Message
type Error = Infallible
Source§impl TryFromInput for PollAnswer
impl TryFromInput for PollAnswer
type Error = Infallible
Source§impl TryFromInput for PreCheckoutQuery
impl TryFromInput for PreCheckoutQuery
type Error = Infallible
Source§impl TryFromInput for ShippingQuery
impl TryFromInput for ShippingQuery
type Error = Infallible
Source§impl TryFromInput for Text
impl TryFromInput for Text
type Error = Infallible
Source§impl TryFromInput for Update
impl TryFromInput for Update
type Error = Infallible
Source§impl TryFromInput for User
impl TryFromInput for User
type Error = Infallible
Source§impl TryFromInput for UserPeerId
impl TryFromInput for UserPeerId
type Error = Infallible
Source§impl TryFromInput for UserUsername
impl TryFromInput for UserUsername
type Error = Infallible
Source§impl<B> TryFromInput for Session<B>where
B: SessionBackend + Send + 'static,
Available on crate feature session
only.
impl<B> TryFromInput for Session<B>where
B: SessionBackend + Send + 'static,
Available on crate feature
session
only.type Error = CreateSessionError
Source§impl<S, B> TryFromInput for DialogueInput<S, B>
Available on crate feature dialogue
only.
impl<S, B> TryFromInput for DialogueInput<S, B>
Available on crate feature
dialogue
only.