pub enum EndpointEvent {
ConnectionFailed {
peer_id: PeerId,
},
ConnectionRequested {
peer_id: PeerId,
socket_addr: SocketAddr,
is_client: bool,
},
Disconnected {
peer_id: PeerId,
reason: Option<String>,
},
ReceivedDatagram {
peer_id: PeerId,
bytes: Bytes,
},
ReceivedMessage {
peer_id: PeerId,
bytes: Bytes,
},
}
Expand description
An event raised on the endpoint.
Variants§
ConnectionFailed
A connection initiated by this endpoint has failed.
ConnectionRequested
A new connection has been requested by a peer.
You can use this to filter connections, limit player counts, etc.
Either accept or reject a connection using RivetsEndpoint::accept
and
RivetsEndpoint::reject
.
Fields
§
socket_addr: SocketAddr
The socket address of the connecting peer.
Disconnected
An accepted connection got disconnected.
This will always be raised regardless of if the peer’s request was accepted or not, because this could happen before the game loop gets to processing the request.
Fields
ReceivedDatagram
A datagram was received from a peer.
ReceivedMessage
A reliable message was received from a peer.
Auto Trait Implementations§
impl !Freeze for EndpointEvent
impl RefUnwindSafe for EndpointEvent
impl Send for EndpointEvent
impl Sync for EndpointEvent
impl Unpin for EndpointEvent
impl UnwindSafe for EndpointEvent
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