Struct pikadick::util::loading_reaction::LoadingReaction
source · pub struct LoadingReaction {
http: Arc<Http>,
channel_id: ChannelId,
msg_id: MessageId,
sent_reaction: bool,
}
Expand description
This type attaches to a message and displays a loading sign until send_ok
or send_err
are called,
where it then displays a check or an X respectively.
If neither are called, send_err is called automatically from the destructor.
All functions are not async and can only be used from a tokio runtime context.
Errors are silently ignored.
Fields§
§http: Arc<Http>
§channel_id: ChannelId
§msg_id: MessageId
§sent_reaction: bool
Implementations§
source§impl LoadingReaction
impl LoadingReaction
sourcepub fn new(http: Arc<Http>, msg: &Message) -> Self
pub fn new(http: Arc<Http>, msg: &Message) -> Self
Create a Loading Reaction attatched to a message.
sourcepub fn send_reaction<T>(&self, reaction: T)where
T: Into<ReactionType>,
pub fn send_reaction<T>(&self, reaction: T)where T: Into<ReactionType>,
Send a reaction.
Trait Implementations§
source§impl Debug for LoadingReaction
impl Debug for LoadingReaction
Auto Trait Implementations§
impl !RefUnwindSafe for LoadingReaction
impl Send for LoadingReaction
impl Sync for LoadingReaction
impl Unpin for LoadingReaction
impl !UnwindSafe for LoadingReaction
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<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request