[][src]Struct serenity::http::typing::Typing

pub struct Typing(_);

A struct to start typing in a Channel for an indefinite period of time.

It indicates that the current user is currently typing in the channel.

Typing is started by using the Typing::start method and stopped by using the Typing::stop method. Note that on some clients, typing may persist for a few seconds after stop is called. Typing is also stopped when the struct is dropped.

If a message is sent while typing is triggered, the user will stop typing for a brief period of time and then resume again until either stop is called or the struct is dropped.

This should rarely be used for bots, although it is a good indicator that a long-running command is still being processed.

Examples

// Initiate typing (assuming `http` is bound)
let typing = Typing::start(Arc::new(http), 7)?;

// Run some long-running process
long_process();

// Stop typing
typing.stop();

Implementations

impl Typing[src]

pub fn start(http: Arc<Http>, channel_id: u64) -> Result<Self>[src]

Starts typing in the specified Channel for an indefinite period of time.

Returns Typing. To stop typing, you must call the Typing::stop method on the returned Typing object or wait for it to be dropped. Note that on some clients, typing may persist for a few seconds after stopped.

pub fn stop(self) -> Option<()>[src]

Stops typing in Channel.

This should be used to stop typing after it is started using Typing::start. Typing may persist for a few seconds on some clients after this is called.

Trait Implementations

impl Debug for Typing[src]

Auto Trait Implementations

impl !RefUnwindSafe for Typing

impl Send for Typing

impl Sync for Typing

impl Unpin for Typing

impl !UnwindSafe for Typing

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WithSubscriber for T[src]