Struct carapax::HandlerInput
source · pub struct HandlerInput {
pub update: Update,
pub context: Arc<Context>,
}
Expand description
An input for a Handler
trait implementations.
Fields§
§update: Update
An Update received from Telegram API.
context: Arc<Context>
A context with shared state.
Trait Implementations§
source§impl Clone for HandlerInput
impl Clone for HandlerInput
source§fn clone(&self) -> HandlerInput
fn clone(&self) -> HandlerInput
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for HandlerInput
impl Debug for HandlerInput
source§impl From<Update> for HandlerInput
impl From<Update> for HandlerInput
source§impl<P> Handler<HandlerInput> for AccessPredicate<P>
Available on crate feature access
only.
impl<P> Handler<HandlerInput> for AccessPredicate<P>
Available on crate feature
access
only.§type Output = Result<bool, <P as AccessPolicy>::Error>
type Output = Result<bool, <P as AccessPolicy>::Error>
A future output returned by
Self::handle
method. Read moresource§impl Handler<HandlerInput> for Chain
impl Handler<HandlerInput> for Chain
§type Output = Result<(), HandlerError>
type Output = Result<(), HandlerError>
A future output returned by
Self::handle
method. Read moresource§impl<B, H, HI, HR, HS, HE> Handler<HandlerInput> for DialogueDecorator<B, H, HI, HS>where
B: SessionBackend + Send + Sync + 'static,
H: Handler<HI, Output = Result<HR, HE>> + Sync + 'static,
HI: TryFromInput + Sync,
HI::Error: 'static,
HR: Into<DialogueResult<HS>>,
HS: DialogueState + Send + Sync,
HE: Error + Send + 'static,
Available on crate feature dialogue
only.
impl<B, H, HI, HR, HS, HE> Handler<HandlerInput> for DialogueDecorator<B, H, HI, HS>where
B: SessionBackend + Send + Sync + 'static,
H: Handler<HI, Output = Result<HR, HE>> + Sync + 'static,
HI: TryFromInput + Sync,
HI::Error: 'static,
HR: Into<DialogueResult<HS>>,
HS: DialogueState + Send + Sync,
HE: Error + Send + 'static,
Available on crate feature
dialogue
only.§type Output = Result<(), HandlerError>
type Output = Result<(), HandlerError>
A future output returned by
Self::handle
method. Read moresource§impl<B, P, PI, PO, HS> Handler<HandlerInput> for DialoguePredicate<B, P, PI, HS>where
B: SessionBackend + Send + Sync + 'static,
P: Handler<PI, Output = PO> + Sync + 'static,
PI: TryFromInput + Sync,
PI::Error: 'static,
PO: Into<PredicateResult>,
HS: DialogueState + Send + Sync,
Available on crate feature dialogue
only.
impl<B, P, PI, PO, HS> Handler<HandlerInput> for DialoguePredicate<B, P, PI, HS>where
B: SessionBackend + Send + Sync + 'static,
P: Handler<PI, Output = PO> + Sync + 'static,
PI: TryFromInput + Sync,
PI::Error: 'static,
PO: Into<PredicateResult>,
HS: DialogueState + Send + Sync,
Available on crate feature
dialogue
only.§type Output = PredicateResult
type Output = PredicateResult
A future output returned by
Self::handle
method. Read moresource§impl<E, H, HI> Handler<HandlerInput> for ErrorDecorator<E, H, HI>where
E: ErrorHandler + Clone + Sync + 'static,
H: Handler<HI> + Sync + 'static,
HI: TryFromInput + Sync,
HI::Error: 'static,
H::Output: IntoHandlerResult,
impl<E, H, HI> Handler<HandlerInput> for ErrorDecorator<E, H, HI>where
E: ErrorHandler + Clone + Sync + 'static,
H: Handler<HI> + Sync + 'static,
HI: TryFromInput + Sync,
HI::Error: 'static,
H::Output: IntoHandlerResult,
§type Output = Result<(), HandlerError>
type Output = Result<(), HandlerError>
A future output returned by
Self::handle
method. Read moresource§impl TryFromInput for HandlerInput
impl TryFromInput for HandlerInput
§type Error = Infallible
type Error = Infallible
An error when conversion failed.
source§async fn try_from_input(
input: HandlerInput
) -> Result<Option<Self>, Self::Error>
async fn try_from_input( input: HandlerInput ) -> Result<Option<Self>, Self::Error>
Performs conversion. Read more
Auto Trait Implementations§
impl Freeze for HandlerInput
impl !RefUnwindSafe for HandlerInput
impl Send for HandlerInput
impl Sync for HandlerInput
impl Unpin for HandlerInput
impl !UnwindSafe for HandlerInput
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
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