pub struct RealtimeCtx {
pub trace_id: Arc<str>,
/* private fields */
}Fields§
§trace_id: Arc<str>Implementations§
Source§impl RealtimeCtx
impl RealtimeCtx
Sourcepub fn new(
tenant: impl Into<Arc<str>>,
user: impl Into<Arc<str>>,
session_id: impl Into<Arc<str>>,
trace_id: impl Into<Arc<str>>,
active_room: Option<String>,
core: Arc<RealtimeCore>,
) -> RealtimeCtx
pub fn new( tenant: impl Into<Arc<str>>, user: impl Into<Arc<str>>, session_id: impl Into<Arc<str>>, trace_id: impl Into<Arc<str>>, active_room: Option<String>, core: Arc<RealtimeCore>, ) -> RealtimeCtx
Construct a per-message context with immutable identity and trace fields.
pub fn tenant(&self) -> &str
pub fn user(&self) -> &str
pub fn user_key(&self) -> &str
pub fn session_id(&self) -> &str
pub fn session_key(&self) -> &str
pub fn active_room(&self) -> Option<&str>
pub fn join_room_with_limits( &self, room: &str, limits: &TenantLimits, ) -> Result<(), WsPrismError>
pub fn leave_room(&self, room: &str)
pub fn send_to_user(&self, out: Outgoing) -> Result<(), WsPrismError>
pub fn send_to_session(&self, out: Outgoing) -> Result<(), WsPrismError>
pub fn publish_room_lossy( &self, room: &str, out: Outgoing, ) -> Result<(), WsPrismError>
pub async fn publish_room_reliable( &self, room: &str, out: Outgoing, ) -> Result<(), WsPrismError>
Trait Implementations§
Source§impl Clone for RealtimeCtx
impl Clone for RealtimeCtx
Source§fn clone(&self) -> RealtimeCtx
fn clone(&self) -> RealtimeCtx
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 moreAuto Trait Implementations§
impl Freeze for RealtimeCtx
impl !RefUnwindSafe for RealtimeCtx
impl Send for RealtimeCtx
impl Sync for RealtimeCtx
impl Unpin for RealtimeCtx
impl !UnwindSafe for RealtimeCtx
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