pub struct BusEvent(pub Value);Expand description
A parsed NOTIFY payload. Kept as loose JSON plus typed accessors so adding fields to the triggers never breaks older consumers.
Tuple Fields§
§0: ValueImplementations§
Source§impl BusEvent
impl BusEvent
pub fn kind(&self) -> &str
pub fn team_id(&self) -> Option<Uuid>
pub fn recipient_agent_id(&self) -> Option<Uuid>
pub fn sender_agent_id(&self) -> Option<Uuid>
pub fn channel_id(&self) -> Option<Uuid>
pub fn message_id(&self) -> Option<i64>
Sourcepub fn recipient_session(&self) -> Option<&str>
pub fn recipient_session(&self) -> Option<&str>
Working context this message was addressed to, if it was addressed to one. Absent means every session of the recipient.
Sourcepub fn sender_session(&self) -> Option<&str>
pub fn sender_session(&self) -> Option<&str>
Working context the message was sent from, if any.
Sourcepub fn is_announcement(&self) -> bool
pub fn is_announcement(&self) -> bool
Was this posted as an announcement — something the sender judged worth interrupting the whole team for?
pub fn is_direct_message(&self) -> bool
Sourcepub fn visible_to(&self, team_id: Uuid, agent_id: Uuid, session: &str) -> bool
pub fn visible_to(&self, team_id: Uuid, agent_id: Uuid, session: &str) -> bool
Is this event visible to session of agent of team?
Direct messages are only visible to their recipient (and sender); everything else is team-wide. A message addressed to one session does not wake the recipient’s other sessions — otherwise every window of a person would wake for a question meant for one of them. It still reaches every session of the sender, which is how a reply finds the window that is blocked waiting for it.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BusEvent
impl RefUnwindSafe for BusEvent
impl Send for BusEvent
impl Sync for BusEvent
impl Unpin for BusEvent
impl UnsafeUnpin for BusEvent
impl UnwindSafe for BusEvent
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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> ⓘ
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> ⓘ
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