Skip to main content

SlackMessage

Struct SlackMessage 

Source
pub struct SlackMessage {
    pub workspace: String,
    pub conversation: String,
    pub conversation_label: String,
    pub ts: String,
    pub thread_ts: Option<String>,
    pub user: Option<String>,
    pub author: Option<String>,
    pub text: String,
    pub parent_user_id: Option<String>,
    pub latest_reply: Option<String>,
    pub edited: Option<String>,
    pub files: Vec<SlackFile>,
}
Expand description

One message as the pump sees it, after matching. Carries what delivery needs and nothing the wire happened to include.

Fields§

§workspace: String§conversation: String§conversation_label: String

Conversation name for display; the DM partner’s id when unnamed. Not Option, so a caller never has to invent a fallback.

§ts: String§thread_ts: Option<String>

None on a message with no thread at all. Equal to ts on a thread’s parent, and the parent’s ts on a reply.

§user: Option<String>§author: Option<String>

The name to display for the author, resolved by the connector: the handle the search path sends, a bot’s own name, or a users.info lookup. None means no name is known, and user carries a raw id that must never be shown as one.

§text: String§parent_user_id: Option<String>

Set on a reply, carrying the parent’s author. This, not thread_ts, is what marks a reply: a parent carries thread_ts too.

§latest_reply: Option<String>

A parent’s newest reply ts. Absent on a message with no replies.

§edited: Option<String>

The ts of the message’s newest edit, absent on one never edited. An edit keeps the message’s own ts, so this is what says the text changed after it was sent - and what keeps a redelivered correction distinct from a re-run of the delivery it corrects.

§files: Vec<SlackFile>

Files shared on the message. A file-share with no text is a real message, and the ids are what slack__attachment fetches with.

Trait Implementations§

Source§

impl Clone for SlackMessage

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SlackMessage

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for SlackMessage

Source§

impl PartialEq for SlackMessage

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for SlackMessage

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more