pub struct ActorHandle<M: MessageTypes> { /* private fields */ }
Expand description
Handle to the server actor task.
Implementations§
Source§impl<M> ActorHandle<M>where
M: MessageTypes,
impl<M> ActorHandle<M>where
M: MessageTypes,
Sourcepub fn message_peer_tcp(&self, peer_uid: PeerUid, msg: M::TcpFromServer)
pub fn message_peer_tcp(&self, peer_uid: PeerUid, msg: M::TcpFromServer)
Send message to client on TCP.
Sourcepub fn message_peer_udp(&self, peer_uid: PeerUid, msg: M::UdpFromServer)
pub fn message_peer_udp(&self, peer_uid: PeerUid, msg: M::UdpFromServer)
Send message to client on UDP (lossy).
Sourcepub fn announce_tcp(&self, msg: M::TcpFromServer)
pub fn announce_tcp(&self, msg: M::TcpFromServer)
Send announcement to all connected clients on TCP.
Sourcepub fn announce_udp(&self, msg: M::UdpFromServer)
pub fn announce_udp(&self, msg: M::UdpFromServer)
Send announcement to all connected clients on UDP (lossy).
Sourcepub async fn get_number_of_connected_peers(&self) -> usize
pub async fn get_number_of_connected_peers(&self) -> usize
Get number of connected peers.
Trait Implementations§
Source§impl<M: Clone + MessageTypes> Clone for ActorHandle<M>
impl<M: Clone + MessageTypes> Clone for ActorHandle<M>
Source§fn clone(&self) -> ActorHandle<M>
fn clone(&self) -> ActorHandle<M>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl<M> Freeze for ActorHandle<M>
impl<M> !RefUnwindSafe for ActorHandle<M>
impl<M> Send for ActorHandle<M>
impl<M> Sync for ActorHandle<M>
impl<M> Unpin for ActorHandle<M>
impl<M> !UnwindSafe for ActorHandle<M>
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