pub struct MessageEvent {
pub id: Uuid,
pub kind: MessageEventKind,
pub content: String,
pub channel_id: String,
pub user_id: String,
pub thread_ts: Option<String>,
pub conversation_id: Option<i32>,
}Expand description
Carries messages between Gateways and the SensoriumLoop.
Fields§
§id: Uuid§kind: MessageEventKind§content: String§channel_id: String§user_id: String§thread_ts: Option<String>§conversation_id: Option<i32>The conversations.id that originated this event.
Set by SensoriumLoop when dispatching inbound messages; used for routing
ProcessEvent deliveries back to the correct gateway channel.
Implementations§
Source§impl MessageEvent
impl MessageEvent
pub fn received( content: impl Into<String>, channel_id: impl Into<String>, user_id: impl Into<String>, ) -> Self
pub fn with_thread_ts(self, thread_ts: impl Into<String>) -> Self
Sourcepub fn with_channel(self, channel_id: impl Into<String>) -> Self
pub fn with_channel(self, channel_id: impl Into<String>) -> Self
Set the target channel for delivery routing (gateway_channel_id from the conversation).
Sourcepub fn with_conversation_id(self, id: i32) -> Self
pub fn with_conversation_id(self, id: i32) -> Self
Attach the originating conversation id for downstream routing.
pub fn delivered(content: impl Into<String>) -> Self
Trait Implementations§
Source§impl Clone for MessageEvent
impl Clone for MessageEvent
Source§fn clone(&self) -> MessageEvent
fn clone(&self) -> MessageEvent
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for MessageEvent
impl RefUnwindSafe for MessageEvent
impl Send for MessageEvent
impl Sync for MessageEvent
impl Unpin for MessageEvent
impl UnsafeUnpin for MessageEvent
impl UnwindSafe for MessageEvent
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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