[−][src]Struct slack::Sender
Thread-safe API for sending messages asynchronously
Implementations
impl Sender
[src]
pub fn get_msg_uid(&self) -> usize
[src]
Get the next message id
A value returned from this method must be included in the JSON payload
(the id
field) when constructing your own message.
pub fn send(&self, raw: &str) -> Result<(), Error>
[src]
Send a raw message
Must set message.id
using result of get_msg_id()
.
Success from this API does not guarantee the message is delivered successfully since that runs on a separate task.
pub fn send_message(&self, channel_id: &str, msg: &str) -> Result<usize, Error>
[src]
Send a message to the specified channel id
Success from this API does not guarantee the message is delivered successfully since that runs on a separate task.
channel_id
is the slack channel id, e.g. UXYZ1234
, not #general
.
Only valid after RtmClient::run
.
pub fn send_typing(&self, channel_id: &str) -> Result<usize, Error>
[src]
Marks connected client as being typing to a channel This is mostly used to signal to other peers that a message is being typed. Will have the server send a "user_typing" message to all the peers. Slack doc can be found at https://api.slack.com/rtm under "Typing Indicators"
channel_id
is the slack channel id, e.g. UXYZ1234
, not #general
.
pub fn subscribe_presence(&self, user_list: &[&str]) -> Result<usize, Error>
[src]
Subscribes to presence updates for the given users This is due to the update in presence events detailed here: https://api.slack.com/changelog/2017-10-making-rtm-presence-subscription-only
user_list
is a slice of the list of users to subscrib, e.g. W839208
, not @xyz.
The full list of users to subscribe to must be sent each time the subscription should
change
Slack doc can be found at https://api.slack.com/docs/presence-and-status under "Determining
user presence"
pub fn shutdown(&self) -> Result<(), Error>
[src]
Shutdown RtmClient
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Sender
impl Send for Sender
impl !Sync for Sender
impl Unpin for Sender
impl !UnwindSafe for Sender
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,