pub struct EventContext {
pub channel: Arc<Channel>,
pub event: Event,
pub user: User,
pub route: Route,
/* private fields */
}Fields§
§channel: Arc<Channel>§event: Event§user: User§route: RouteImplementations§
Source§impl EventContext
impl EventContext
pub fn new( channel: Arc<Channel>, event: Event, user: User, route: Route, ) -> Self
pub async fn reply(&mut self, event: &str, payload: Value) -> Result<()>
pub async fn broadcast(&self, event: &str, payload: Value) -> Result<()>
pub async fn broadcast_to( &self, event: &str, payload: Value, user_ids: &[String], ) -> Result<()>
pub async fn broadcast_from(&self, event: &str, payload: Value) -> Result<()>
pub async fn track(&self, presence: Value) -> Result<()>
pub async fn update_presence(&self, presence: Value) -> Result<()>
pub async fn untrack(&self) -> Result<()>
pub async fn evict(&self, reason: &str, user_ids: &[String]) -> Result<()>
Auto Trait Implementations§
impl !RefUnwindSafe for EventContext
impl !UnwindSafe for EventContext
impl Freeze for EventContext
impl Send for EventContext
impl Sync for EventContext
impl Unpin for EventContext
impl UnsafeUnpin for EventContext
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