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 a shared reference to the inner socket.

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.

Send a message to the specified address.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.