pub struct CoreLocalAdapter<E> { /* private fields */ }
Expand description
The default adapter. Store the state in memory.
Implementations§
Source§impl<E: SocketEmitter> CoreLocalAdapter<E>
impl<E: SocketEmitter> CoreLocalAdapter<E>
Sourcepub fn broadcast(
&self,
packet: Packet,
opts: BroadcastOptions,
) -> Result<(), Vec<SocketError>>
pub fn broadcast( &self, packet: Packet, opts: BroadcastOptions, ) -> Result<(), Vec<SocketError>>
Broadcasts the packet to the sockets that match the BroadcastOptions
.
Sourcepub fn broadcast_with_ack(
&self,
packet: Packet,
opts: BroadcastOptions,
timeout: Option<Duration>,
) -> (E::AckStream, u32)
pub fn broadcast_with_ack( &self, packet: Packet, opts: BroadcastOptions, timeout: Option<Duration>, ) -> (E::AckStream, u32)
Broadcasts the packet to the sockets that match the BroadcastOptions
and return a stream of ack responses.
Also returns the number of local expected aknowledgements to know when to stop waiting.
Sourcepub fn sockets(&self, opts: BroadcastOptions) -> Vec<Sid>
pub fn sockets(&self, opts: BroadcastOptions) -> Vec<Sid>
Returns the sockets ids that match the BroadcastOptions
.
Sourcepub fn fetch_sockets(&self, opts: BroadcastOptions) -> Vec<RemoteSocketData>
pub fn fetch_sockets(&self, opts: BroadcastOptions) -> Vec<RemoteSocketData>
Returns the sockets ids that match the BroadcastOptions
.
Sourcepub fn socket_rooms(&self, sid: Sid) -> HashSet<Room>
pub fn socket_rooms(&self, sid: Sid) -> HashSet<Room>
Returns the rooms of the socket.
Sourcepub fn add_sockets(&self, opts: BroadcastOptions, rooms: impl RoomParam)
pub fn add_sockets(&self, opts: BroadcastOptions, rooms: impl RoomParam)
Adds the sockets that match the BroadcastOptions
to the rooms.
Sourcepub fn del_sockets(&self, opts: BroadcastOptions, rooms: impl RoomParam)
pub fn del_sockets(&self, opts: BroadcastOptions, rooms: impl RoomParam)
Removes the sockets that match the BroadcastOptions
from the rooms.
Sourcepub fn disconnect_socket(
&self,
opts: BroadcastOptions,
) -> Result<(), Vec<SocketError>>
pub fn disconnect_socket( &self, opts: BroadcastOptions, ) -> Result<(), Vec<SocketError>>
Disconnects the sockets that match the BroadcastOptions
.
Sourcepub fn rooms(&self, opts: BroadcastOptions) -> HashSet<Room>
pub fn rooms(&self, opts: BroadcastOptions) -> HashSet<Room>
Returns all the matching rooms
Auto Trait Implementations§
impl<E> !Freeze for CoreLocalAdapter<E>
impl<E> RefUnwindSafe for CoreLocalAdapter<E>where
E: RefUnwindSafe,
impl<E> Send for CoreLocalAdapter<E>where
E: Send,
impl<E> Sync for CoreLocalAdapter<E>where
E: Sync,
impl<E> Unpin for CoreLocalAdapter<E>where
E: Unpin,
impl<E> UnwindSafe for CoreLocalAdapter<E>where
E: UnwindSafe,
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