pub struct WebRoom { /* private fields */ }Expand description
A live web room for page sharing. WebRoom wraps Room and carries presence
and small DOM mutations. Initial HTML and media bytes travel over HTTP
bootstrap/asset routes, not this socket.
Implementations§
Source§impl WebRoom
impl WebRoom
pub fn set_hooks(&self, hooks: Arc<dyn WebRoomHooks>)
Sourcepub fn from_parent(
parent: &Room,
hooks: Option<Arc<dyn WebRoomHooks>>,
connection_state: &Value,
) -> WebRoom
pub fn from_parent( parent: &Room, hooks: Option<Arc<dyn WebRoomHooks>>, connection_state: &Value, ) -> WebRoom
Ingest-only child of a MachineRoom (same socket).
Sourcepub fn get_host_principal(&self) -> Option<String>
pub fn get_host_principal(&self) -> Option<String>
Host principal tagged string, if the connection provided it.
Sourcepub fn can_invite(&self) -> bool
pub fn can_invite(&self) -> bool
Whether this signed-in caller may invite others (server-gated).
pub fn get_snapshot(&self) -> Option<WebSnapshot>
pub fn get_bootstrap(&self) -> Option<BootstrapMeta>
pub fn disconnect(&self)
pub fn ingest_snapshot(&self, snapshot: WebSnapshot)
pub fn ingest_bootstrap(&self, meta: BootstrapMeta)
pub fn publish_bootstrap(&self, meta: BootstrapMeta)
pub fn publish_snapshot(&self, snapshot: WebSnapshot)
pub fn publish_mutation(&self, mutation: &WebMutation)
pub fn publish_closed(&self)
Sourcepub fn set_tool_handler(
&self,
handler: WebToolHandler,
) -> Box<dyn FnOnce() + Send + Sync>
pub fn set_tool_handler( &self, handler: WebToolHandler, ) -> Box<dyn FnOnce() + Send + Sync>
Host: fulfill inbound web-tool-call frames. Returns a function that removes the handler.
Sourcepub async fn invoke_tool(
&self,
name: &str,
params: Map<String, Value>,
timeout_ms: Option<u64>,
) -> Result<String>
pub async fn invoke_tool( &self, name: &str, params: Map<String, Value>, timeout_ms: Option<u64>, ) -> Result<String>
Any member: ask the host to run a page tool. Times out after timeout_ms
(30 seconds by default).
pub fn handle_event(&self, packet: &Value) -> bool
Methods from Deref<Target = Room>§
pub fn endpoint(&self) -> &str
pub fn ws(&self) -> RoomSocket
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 Forget for WebRoom
impl Freeze for WebRoomwhere
*const ArcInner<RoomInner> is !null: Freeze,
PhantomData<ArcInner<RoomInner>>: Freeze,
*const ArcInner<Mutex<WebState>> is !null: Freeze,
PhantomData<ArcInner<Mutex<WebState>>>: Freeze,
impl Move for WebRoom
impl RefUnwindSafe for WebRoomwhere
Atomic<usize>: RefUnwindSafe,
Chan<Message, Semaphore>: RefUnwindSafe,
Mutex<Vec<Presence>>: RefUnwindSafe,
RwLock<bool>: RefUnwindSafe,
AtomicUsize: RefUnwindSafe,
Notify: RefUnwindSafe,
Atomic<bool>: RefUnwindSafe,
Mutex<WebState>: RefUnwindSafe,
impl Send for WebRoom
impl Sync for WebRoom
impl Unpin for WebRoom
impl UnsafeUnpin for WebRoomwhere
*const ArcInner<RoomInner> is !null: UnsafeUnpin,
PhantomData<ArcInner<RoomInner>>: UnsafeUnpin,
*const ArcInner<Mutex<WebState>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Mutex<WebState>>>: UnsafeUnpin,
impl UnwindSafe for WebRoom
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