Struct abbegm::tokio_peer::EgmPeer [−][src]
pub struct EgmPeer { /* fields omitted */ }
Expand description
Asynchronous EGM peer capable of sending and receiving messages.
Implementations
Wrap an existing UDP socket in a peer.
If you want to use the EgmPeer::recv
and EgmPeer::send
functions,
you should use an already connected socket.
Otherwise, you can only use EgmPeer::recv_from
and EgmPeer::send_to
.
Create an EGM peer on a newly bound UDP socket.
The socket will not be connected to a remote peer,
so you can only use EgmPeer::recv_from
and EgmPeer::send_to
.
Synchronously create an EGM peer on a newly bound UDP socket.
This function allows you to create the peer synchronously, but use an asynchronous API for communicating with the robot. This can be useful if you want to perform initialization of your application synchronously.
The socket will not be connected to a remote peer,
so you can only use EgmPeer::recv_from
and EgmPeer::send_to
.
Get an exclusive reference to the inner socket.
Consume self and get the inner socket.
Receive a message from the remote address to which the inner socket is connected.
To use this function, you must pass an already connected socket to EgmPeer::new
.
If the peer was created with an unconnected socket, this function will panic.
Receive a message from any remote address.
Purge all messages from the socket read queue.
Send a message to the remote address to which the inner socket is connected.
To use this function, you must pass an already connected socket to EgmPeer::new
.
If the peer was created with an unconnected socket, this function will panic.