pub struct RemoteSocket<A> { /* private fields */ }Expand description
Implementations§
Source§impl<A> RemoteSocket<A>
impl<A> RemoteSocket<A>
Sourcepub fn into_data(self) -> RemoteSocketData
pub fn into_data(self) -> RemoteSocketData
Consume the RemoteSocket and return its underlying data
Sourcepub fn data(&self) -> &RemoteSocketData
pub fn data(&self) -> &RemoteSocketData
Get a ref to the underlying data of the socket
Source§impl<A: Adapter> RemoteSocket<A>
impl<A: Adapter> RemoteSocket<A>
Sourcepub async fn emit<T: ?Sized + Serialize>(
&self,
event: impl AsRef<str>,
data: &T,
) -> Result<(), RemoteActionError>
pub async fn emit<T: ?Sized + Serialize>( &self, event: impl AsRef<str>, data: &T, ) -> Result<(), RemoteActionError>
§Emit a message to a client that is remotely connected on another server.
See Socket::emit for more info.
Sourcepub async fn emit_with_ack<T: ?Sized + Serialize, V: DeserializeOwned>(
&self,
event: impl AsRef<str>,
data: &T,
) -> Result<AckStream<V, A>, RemoteActionError>
pub async fn emit_with_ack<T: ?Sized + Serialize, V: DeserializeOwned>( &self, event: impl AsRef<str>, data: &T, ) -> Result<AckStream<V, A>, RemoteActionError>
§Emit a message to a client that is remotely connected on another server and wait for an acknowledgement.
See Socket::emit_with_ack for more info.
Sourcepub async fn rooms(&self) -> Result<Vec<Room>, A::Error>
pub async fn rooms(&self) -> Result<Vec<Room>, A::Error>
§Get all room names this remote socket is connected to.
See Socket::rooms for more info.
Sourcepub fn join(
&self,
rooms: impl RoomParam,
) -> impl Future<Output = Result<(), A::Error>> + '_
pub fn join( &self, rooms: impl RoomParam, ) -> impl Future<Output = Result<(), A::Error>> + '_
§Add the remote socket to the specified room(s).
See Socket::join for more info.
Sourcepub fn leave(
&self,
rooms: impl RoomParam,
) -> impl Future<Output = Result<(), A::Error>> + Send + '_
pub fn leave( &self, rooms: impl RoomParam, ) -> impl Future<Output = Result<(), A::Error>> + Send + '_
§Remove the remote socket from the specified room(s).
See Socket::leave for more info.
Sourcepub async fn disconnect(self) -> Result<(), RemoteActionError>
pub async fn disconnect(self) -> Result<(), RemoteActionError>
§Disconnect the remote socket from the current namespace,
See Socket::disconnect for more info.
Trait Implementations§
Source§impl<A> Clone for RemoteSocket<A>
impl<A> Clone for RemoteSocket<A>
Auto Trait Implementations§
impl<A> !Freeze for RemoteSocket<A>
impl<A> RefUnwindSafe for RemoteSocket<A>where
A: RefUnwindSafe,
impl<A> Send for RemoteSocket<A>
impl<A> Sync for RemoteSocket<A>
impl<A> Unpin for RemoteSocket<A>
impl<A> UnwindSafe for RemoteSocket<A>where
A: RefUnwindSafe,
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