pub struct ClientState {
pub ref_counter: u64,
pub pending_heartbeat_ref: Option<String>,
pub channels: Vec<Arc<RealtimeChannel>>,
pub task_manager: TaskManager,
pub was_manual_disconnect: bool,
pub state_change_tx: Option<Sender<(ConnectionState, bool)>>,
}Expand description
Consolidated mutable state for RealtimeClient Using a single struct reduces lock contention
Fields§
§ref_counter: u64Current ref counter for message IDs
pending_heartbeat_ref: Option<String>Pending heartbeat ref (if any)
channels: Vec<Arc<RealtimeChannel>>All channels managed by this client
task_manager: TaskManagerBackground task manager
was_manual_disconnect: boolWhether the disconnect was manual (prevents auto-reconnect)
state_change_tx: Option<Sender<(ConnectionState, bool)>>Sender for state change notifications
Implementations§
Source§impl ClientState
impl ClientState
pub fn new() -> Self
Sourcepub fn notify_state_change(&self, state: ConnectionState, manual: bool)
pub fn notify_state_change(&self, state: ConnectionState, manual: bool)
Notify state change watchers
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ClientState
impl !RefUnwindSafe for ClientState
impl Send for ClientState
impl Sync for ClientState
impl Unpin for ClientState
impl !UnwindSafe for ClientState
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