pub struct TypingGuard { /* private fields */ }Expand description
Scoped typing indicator. Keeps the action alive by re-sending it every ~4 seconds (Telegram drops the indicator after ~5 s).
Drop this guard to cancel the action immediately.
Implementations§
Source§impl TypingGuard
impl TypingGuard
Sourcepub async fn start(
client: &Client,
peer: Peer,
action: SendMessageAction,
) -> Result<Self, InvocationError>
pub async fn start( client: &Client, peer: Peer, action: SendMessageAction, ) -> Result<Self, InvocationError>
Send action to peer and keep repeating it until the guard is dropped.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TypingGuard
impl RefUnwindSafe for TypingGuard
impl Send for TypingGuard
impl Sync for TypingGuard
impl Unpin for TypingGuard
impl UnsafeUnpin for TypingGuard
impl UnwindSafe for TypingGuard
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> 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