pub struct InProcessRealtime { /* private fields */ }Expand description
A Realtime adapter that holds every room’s sockets in this process.
Implementations§
Source§impl InProcessRealtime
impl InProcessRealtime
pub fn new(handler: Arc<dyn RoomHandler>) -> Self
Sourcepub async fn connect(
&self,
room_id: &str,
member: Member,
) -> Result<Connection, RealtimeError>
pub async fn connect( &self, room_id: &str, member: Member, ) -> Result<Connection, RealtimeError>
Opens a socket for member in room_id: registers its outgoing
channel, runs RoomHandler::on_join, and returns a Connection the
caller pumps. next_outgoing yields messages to write to the socket;
deliver feeds messages received from it; close ends the membership.
§Panics
Panics if the room registry lock is poisoned.
§Errors
Propagates any RealtimeError the handler’s on_join returns.
Trait Implementations§
Source§impl Clone for InProcessRealtime
impl Clone for InProcessRealtime
Source§fn clone(&self) -> InProcessRealtime
fn clone(&self) -> InProcessRealtime
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Realtime for InProcessRealtime
impl Realtime for InProcessRealtime
Source§fn broadcast<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
room_id: &'life1 str,
message: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<(), RealtimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn broadcast<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
room_id: &'life1 str,
message: &'life2 [u8],
) -> Pin<Box<dyn Future<Output = Result<(), RealtimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Send
message to every socket in room_id.Auto Trait Implementations§
impl !RefUnwindSafe for InProcessRealtime
impl !UnwindSafe for InProcessRealtime
impl Freeze for InProcessRealtime
impl Send for InProcessRealtime
impl Sync for InProcessRealtime
impl Unpin for InProcessRealtime
impl UnsafeUnpin for InProcessRealtime
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