pub struct InteractionsEndpoint<B: Backend = DashMapBackend> { /* private fields */ }Expand description
Answers the interactions Discord posts to the app’s Interactions Endpoint URL with a
Client’s routes and handlers; made by
Client::interactions_endpoint. Cheap to clone.
See the module for what handle does.
discord.js counterpart: none.
Implementations§
Source§impl<B: Backend> InteractionsEndpoint<B>
impl<B: Backend> InteractionsEndpoint<B>
Sourcepub async fn handle(
&self,
signature: &str,
timestamp: &str,
body: &[u8],
) -> (HttpResponse, impl Future<Output = ()> + Send + 'static + use<B>)
pub async fn handle( &self, signature: &str, timestamp: &str, body: &[u8], ) -> (HttpResponse, impl Future<Output = ()> + Send + 'static + use<B>)
Handles one request to the Interactions Endpoint URL: signature and timestamp are
its X-Signature-Ed25519 and X-Signature-Timestamp headers (pass "" for a missing
one), body its raw body. Returns the response to send and the future of the
handlers’ remaining work, which must be run (tokio::spawn, or ctx.wait_until on
Cloudflare Workers) for follow-ups to happen.
Returns as soon as a handler gives the initial response: Discord waits at most 3 seconds for it. See the module for every status.
discord.js counterpart: none; verifyKey of the discord-interactions package for
the verification.
Trait Implementations§
Source§impl<B: Backend> Clone for InteractionsEndpoint<B>
impl<B: Backend> Clone for InteractionsEndpoint<B>
Auto Trait Implementations§
impl<B = DashMapBackend> !RefUnwindSafe for InteractionsEndpoint<B>
impl<B = DashMapBackend> !UnwindSafe for InteractionsEndpoint<B>
impl<B> Freeze for InteractionsEndpoint<B>
impl<B> Send for InteractionsEndpoint<B>
impl<B> Sync for InteractionsEndpoint<B>
impl<B> Unpin for InteractionsEndpoint<B>
impl<B> UnsafeUnpin for InteractionsEndpoint<B>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Classify for T
impl<T> Classify for T
type Classified = T
fn classify(self) -> T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Declassify for T
impl<T> Declassify for T
type Declassified = T
fn declassify(self) -> T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
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> ⓘ
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