pub struct RealtimePusher { /* private fields */ }Implementations§
Source§impl RealtimePusher
impl RealtimePusher
pub fn new() -> Self
pub async fn register_connection(&self, connection_id: impl Into<String>)
pub async fn register_connection_with_user( &self, connection_id: impl Into<String>, user_id: i64, )
pub async fn unregister_connection(&self, connection_id: &str)
pub async fn subscribe( &self, connection_id: &str, room: &str, ) -> Result<(), WsError>
pub async fn unsubscribe(&self, connection_id: &str, room: &str)
pub async fn push_to_connection( &self, connection_id: &str, message: Vec<u8>, ) -> Result<(), WsError>
pub async fn push_to_room( &self, room: &str, message: Vec<u8>, ) -> Result<usize, WsError>
pub async fn push_to_user( &self, user_id: i64, message: Vec<u8>, ) -> Result<usize, WsError>
pub async fn push_order_status( &self, user_id: i64, order_id: i64, status: &str, ) -> Result<usize, WsError>
pub async fn push_customer_message( &self, room_id: &str, sender_id: i64, content: &str, ) -> Result<usize, WsError>
pub async fn broadcast(&self, message: Vec<u8>) -> Result<usize, WsError>
pub async fn connection_count(&self) -> usize
pub async fn room_count(&self, room: &str) -> usize
pub async fn room_list(&self) -> Vec<String>
Sourcepub async fn messages_for(&self, connection_id: &str) -> Vec<Vec<u8>>
pub async fn messages_for(&self, connection_id: &str) -> Vec<Vec<u8>>
Returns all messages sent to the given connection, in delivery order.
Sourcepub async fn message_count(&self, connection_id: &str) -> usize
pub async fn message_count(&self, connection_id: &str) -> usize
Returns the number of messages sent to the given connection.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for RealtimePusher
impl !UnwindSafe for RealtimePusher
impl Freeze for RealtimePusher
impl Send for RealtimePusher
impl Sync for RealtimePusher
impl Unpin for RealtimePusher
impl UnsafeUnpin for RealtimePusher
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