pub struct ChannelManager { /* private fields */ }Expand description
Manager struct for a [RealtimeChannel]
Returned by RealtimeChannelBuilder::build()
Implementations§
Source§impl ChannelManager
impl ChannelManager
Sourcepub async fn unsubscribe(
&self,
) -> Result<Result<ChannelState, ChannelSendError>, RecvError>
pub async fn unsubscribe( &self, ) -> Result<Result<ChannelState, ChannelSendError>, RecvError>
Leave the channel and stop recieving messages
Once unsubscribed this manager is useless and should be dropped
Sourcepub async fn subscribe_blocking(&self) -> Result<(), RecvError>
pub async fn subscribe_blocking(&self) -> Result<(), RecvError>
Send a JoinMessage for the channel and wait until the server has responded
Sourcepub fn broadcast(&self, payload: BroadcastPayload)
pub fn broadcast(&self, payload: BroadcastPayload)
Send a broadcast message on the channel
Sourcepub async fn track(
&self,
payload: HashMap<String, Value>,
) -> Result<(), RecvError>
pub async fn track( &self, payload: HashMap<String, Value>, ) -> Result<(), RecvError>
Track data in Presence
Sourcepub async fn get_state(&self) -> Result<ChannelState, RecvError>
pub async fn get_state(&self) -> Result<ChannelState, RecvError>
Returns the ChannelState for the associated channel
Sourcepub async fn get_presence_state(&self) -> PresenceState
pub async fn get_presence_state(&self) -> PresenceState
Returns the current PresenceState of the associated channel
Sourcepub fn to_sync(self) -> ChannelManagerSync
pub fn to_sync(self) -> ChannelManagerSync
Return a sync wrapper ChannelManagerSync for this manager
Trait Implementations§
Source§impl Clone for ChannelManager
impl Clone for ChannelManager
Source§fn clone(&self) -> ChannelManager
fn clone(&self) -> ChannelManager
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 moreSource§impl Debug for ChannelManager
impl Debug for ChannelManager
Source§impl<'a> FromIterator<&'a mut ChannelManager> for Vec<ChannelManager>
impl<'a> FromIterator<&'a mut ChannelManager> for Vec<ChannelManager>
Source§fn from_iter<T: IntoIterator<Item = &'a mut ChannelManager>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = &'a mut ChannelManager>>(iter: T) -> Self
Creates a value from an iterator. Read more
Auto Trait Implementations§
impl Freeze for ChannelManager
impl RefUnwindSafe for ChannelManager
impl Send for ChannelManager
impl Sync for ChannelManager
impl Unpin for ChannelManager
impl UnwindSafe for ChannelManager
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