pub struct RealtimeChannel { /* private fields */ }Expand description
A handle to a subscribed realtime channel.
This is cheaply cloneable and Send + Sync.
Implementations§
Source§impl RealtimeChannel
impl RealtimeChannel
Sourcepub async fn state(&self) -> ChannelState
pub async fn state(&self) -> ChannelState
Get the current channel state.
Sourcepub async fn send_broadcast(
&self,
event: &str,
payload: Value,
) -> Result<(), RealtimeError>
pub async fn send_broadcast( &self, event: &str, payload: Value, ) -> Result<(), RealtimeError>
Send a broadcast message on this channel.
Sourcepub async fn track(&self, payload: Value) -> Result<(), RealtimeError>
pub async fn track(&self, payload: Value) -> Result<(), RealtimeError>
Track presence state on this channel.
Sourcepub async fn untrack(&self) -> Result<(), RealtimeError>
pub async fn untrack(&self) -> Result<(), RealtimeError>
Stop tracking presence on this channel.
Sourcepub async fn presence_state(&self) -> PresenceState
pub async fn presence_state(&self) -> PresenceState
Get the current presence state for this channel.
Sourcepub async fn unsubscribe(&self) -> Result<(), RealtimeError>
pub async fn unsubscribe(&self) -> Result<(), RealtimeError>
Unsubscribe from this channel. Sends phx_leave.
Sourcepub async fn update_access_token(
&self,
token: &str,
) -> Result<(), RealtimeError>
pub async fn update_access_token( &self, token: &str, ) -> Result<(), RealtimeError>
Update the access token for this channel (e.g., after token refresh).
Trait Implementations§
Source§impl Clone for RealtimeChannel
impl Clone for RealtimeChannel
Source§fn clone(&self) -> RealtimeChannel
fn clone(&self) -> RealtimeChannel
Returns a duplicate of the value. Read more
1.0.0 · 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 RealtimeChannel
impl !RefUnwindSafe for RealtimeChannel
impl Send for RealtimeChannel
impl Sync for RealtimeChannel
impl Unpin for RealtimeChannel
impl UnsafeUnpin for RealtimeChannel
impl !UnwindSafe for RealtimeChannel
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