pub enum InteractionOutcome {
Unauthorized,
BadRequest(Error),
Respond(InteractionResponse),
HandlerFailed {
error: HandlerError,
response: InteractionResponse,
},
}Available on crate feature
rest only.Expand description
What to answer one interaction request with. Produced by handle_interaction.
Variants§
Signature headers missing or invalid
BadRequest(Error)
Signature valid but the body is not an interaction
Respond(InteractionResponse)
The interaction was handled
HandlerFailed
The handler returned an error; response is the ephemeral error message sent instead
Fields
§
error: HandlerErrorWhat went wrong, for the log
§
response: InteractionResponseThe ephemeral error message to answer with
Implementations§
Source§impl InteractionOutcome
impl InteractionOutcome
Sourcepub fn status(&self) -> u16
pub fn status(&self) -> u16
HTTP status to send (responses with files go through send_with_files, then 202)
Sourcepub fn response(&self) -> Option<&InteractionResponse>
pub fn response(&self) -> Option<&InteractionResponse>
JSON body to send, for 200 outcomes
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for InteractionOutcome
impl !UnwindSafe for InteractionOutcome
impl Freeze for InteractionOutcome
impl Send for InteractionOutcome
impl Sync for InteractionOutcome
impl Unpin for InteractionOutcome
impl UnsafeUnpin for InteractionOutcome
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