#[non_exhaustive]pub enum ServerEvent {
Connected {
id: u32,
transport: Transport,
addr: Option<SocketAddr>,
},
Message {
id: u32,
seq: u16,
data: Vec<u8>,
},
Reliable {
id: u32,
data: Vec<u8>,
},
Delivered {
id: u32,
seq: u16,
},
Lost {
id: u32,
seq: u16,
},
Disconnected {
id: u32,
reason: Reason,
},
}Expand description
what happened on the server
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Connected
a client came (addr: its address, if the transport knows it)
Message
a message of a client
Reliable
a message of a client’s reliable channel, whole and in order
Delivered
a client has a packet the server sent
Lost
a packet the server sent did not reach the client (UDP)
Disconnected
a client is gone
Trait Implementations§
Source§impl Clone for ServerEvent
impl Clone for ServerEvent
Source§impl Debug for ServerEvent
impl Debug for ServerEvent
impl Eq for ServerEvent
Source§impl PartialEq for ServerEvent
impl PartialEq for ServerEvent
impl StructuralPartialEq for ServerEvent
Auto Trait Implementations§
impl Forget for ServerEvent
impl Freeze for ServerEvent
impl Move for ServerEvent
impl RefUnwindSafe for ServerEvent
impl Send for ServerEventwhere
RawVecInner: Send,
impl Sync for ServerEventwhere
RawVecInner: Sync,
impl Unpin for ServerEvent
impl UnsafeUnpin for ServerEvent
impl UnwindSafe for ServerEventwhere
RawVecInner: UnwindSafe,
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