pub struct Broadcasting { /* private fields */ }Expand description
Publishes broadcasts through the configured driver.
What the Broadcast facade
resolves to.
Implementations§
Source§impl Broadcasting
impl Broadcasting
Sourcepub fn new(driver: Arc<dyn Broadcaster>) -> Broadcasting
pub fn new(driver: Arc<dyn Broadcaster>) -> Broadcasting
Publishing through driver.
Sourcepub fn log() -> Broadcasting
pub fn log() -> Broadcasting
Publishing to the log — the safe default, and what an unconfigured application gets.
Sourcepub fn driver_name(&self) -> &'static str
pub fn driver_name(&self) -> &'static str
The driver’s name.
Sourcepub fn driver(&self) -> &Arc<dyn Broadcaster> ⓘ
pub fn driver(&self) -> &Arc<dyn Broadcaster> ⓘ
The driver, for the auth endpoint’s signature.
Sourcepub async fn event<E>(&self, event: &E) -> Result<(), Error>where
E: Broadcastable + ?Sized,
pub async fn event<E>(&self, event: &E) -> Result<(), Error>where
E: Broadcastable + ?Sized,
Publish an event.
Does nothing when the event says broadcast_when
is false, or when it named no channels — both are answers, not errors.
Sourcepub async fn event_except<E>(
&self,
event: &E,
socket_id: Option<String>,
) -> Result<(), Error>where
E: Broadcastable + ?Sized,
pub async fn event_except<E>(
&self,
event: &E,
socket_id: Option<String>,
) -> Result<(), Error>where
E: Broadcastable + ?Sized,
Publish an event to everyone except one socket.
The browser that caused the change has already applied it locally;
echoing it back makes its own edit flicker. socket_id comes from the
request’s X-Socket-ID header, and None means broadcast to all.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Broadcasting
impl !UnwindSafe for Broadcasting
impl Freeze for Broadcasting
impl Send for Broadcasting
impl Sync for Broadcasting
impl Unpin for Broadcasting
impl UnsafeUnpin for Broadcasting
Blanket Implementations§
impl<T> Actor for T
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.