pub struct CombatConnection { /* private fields */ }Expand description
A live combat connection. Use CombatConnection::split to send and
receive from different tasks.
Implementations§
Source§impl CombatConnection
impl CombatConnection
Sourcepub async fn send(
&mut self,
envelope: &CommandEnvelope,
) -> Result<(), ClientError>
pub async fn send( &mut self, envelope: &CommandEnvelope, ) -> Result<(), ClientError>
Sends a command; its events come back like everyone else’s.
Sourcepub async fn recv(&mut self) -> Option<Result<ServerMessage, ClientError>>
pub async fn recv(&mut self) -> Option<Result<ServerMessage, ClientError>>
The next message from the server; None once the connection has
closed.
Sourcepub fn split(self) -> (CommandSender, MessageReceiver)
pub fn split(self) -> (CommandSender, MessageReceiver)
Splits the connection, to send and receive from different tasks.
Auto Trait Implementations§
impl !Freeze for CombatConnection
impl !RefUnwindSafe for CombatConnection
impl Send for CombatConnection
impl Sync for CombatConnection
impl Unpin for CombatConnection
impl UnsafeUnpin for CombatConnection
impl !UnwindSafe for CombatConnection
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