pub struct PresenceTracker { /* private fields */ }Expand description
Applies Phoenix Presence state and diff frames in join-generation order.
Implementations§
Source§impl PresenceTracker
impl PresenceTracker
Sourcepub fn with_events(
state_event: impl Into<String>,
diff_event: impl Into<String>,
) -> Self
pub fn with_events( state_event: impl Into<String>, diff_event: impl Into<String>, ) -> Self
Creates a tracker with application-specific state and diff event names.
Sourcepub fn state(&self) -> &PresenceState
pub fn state(&self) -> &PresenceState
Returns the current synchronized state.
Sourcepub fn apply(&mut self, frame: &Frame) -> Result<PresenceUpdate, PresenceError>
pub fn apply(&mut self, frame: &Frame) -> Result<PresenceUpdate, PresenceError>
Applies a Phoenix frame and returns its Presence effect.
Trait Implementations§
Source§impl Clone for PresenceTracker
impl Clone for PresenceTracker
Source§fn clone(&self) -> PresenceTracker
fn clone(&self) -> PresenceTracker
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 PresenceTracker
impl Debug for PresenceTracker
Auto Trait Implementations§
impl Freeze for PresenceTracker
impl RefUnwindSafe for PresenceTracker
impl Send for PresenceTracker
impl Sync for PresenceTracker
impl Unpin for PresenceTracker
impl UnsafeUnpin for PresenceTracker
impl UnwindSafe for PresenceTracker
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