pub struct BroadcastChannel { /* private fields */ }Expand description
Sends notifications to a private channel for the recipient.
Laravel’s broadcast notification channel. The channel name is
notifications.{type}.{id} — for example private-notifications.User.7 on
the wire — so one subscription receives everything sent to that recipient,
whatever the notification turns out to be.
Uses to_data, falling back to
to_text wrapped as
{"message": …}.
§It is not a delivery
A broadcast reaches whoever is connected at that instant and nobody else. Pair it with the database channel, which is what makes the notification survive a reload — this one only makes the bell menu move without one.
Implementations§
Source§impl BroadcastChannel
impl BroadcastChannel
Sourcepub fn new(broadcasting: Arc<Broadcasting>) -> Self
pub fn new(broadcasting: Arc<Broadcasting>) -> Self
A channel publishing through broadcasting.
Sourcepub fn channel_for(notifiable_type: &str, notifiable_id: &str) -> Channel
pub fn channel_for(notifiable_type: &str, notifiable_id: &str) -> Channel
The channel a recipient’s notifications are published on.
The pattern to authorise is notifications.{type}.{id}.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for BroadcastChannel
impl !UnwindSafe for BroadcastChannel
impl Freeze for BroadcastChannel
impl Send for BroadcastChannel
impl Sync for BroadcastChannel
impl Unpin for BroadcastChannel
impl UnsafeUnpin for BroadcastChannel
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Event for T
impl<T> Event for T
Source§fn event_name() -> &'static strwhere
Self: Sized,
fn event_name() -> &'static strwhere
Self: Sized,
A human-readable name, used by wildcard listeners and log output.
Always the Rust type path; see the trait docs.
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 moreCreates a shared type from an unshared type.