pub struct StateRoom { /* private fields */ }Expand description
A live room you are in: its state, kept current, and who else is here.
Implementations§
Source§impl StateRoom
impl StateRoom
pub fn name(&self) -> String
pub fn state(&self) -> Value
pub fn version(&self) -> u64
pub fn hydrate(&self, snapshot: &Value)
pub fn handle_event(&self, packet: &Value) -> bool
Sourcepub fn set_state(&self, state: &Value, if_version: Option<u64>)
pub fn set_state(&self, state: &Value, if_version: Option<u64>)
Replace the state for everyone here. Writers only; with if_version, only
while the room is at that version.
pub async fn connect( authorization: &CredentialsOrApiKey, target_id: &str, hooks: Option<Arc<dyn Hooks>>, ) -> Result<(StateRoom, Presence)>
Methods from Deref<Target = Room>§
pub fn endpoint(&self) -> &str
pub fn id(&self) -> &str
pub fn get_presences(&self) -> Vec<Presence>
The caller’s Credentials or ApiKey from the live authorization pack.
pub fn post(&self, packet: &Value)
pub fn disconnect(&self)
pub async fn generate_access_code(&self) -> Result<String>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StateRoom
impl RefUnwindSafe for StateRoom
impl Send for StateRoom
impl Sync for StateRoom
impl Unpin for StateRoom
impl UnsafeUnpin for StateRoom
impl UnwindSafe for StateRoom
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