Enum amethyst_network::NetEvent
source · pub enum NetEvent<T> {
Connect {
client_uuid: Uuid,
},
Connected {
server_uuid: Uuid,
},
ConnectionRefused {
reason: String,
},
Disconnect {
reason: String,
},
Disconnected {
reason: String,
},
TextMessage {
msg: String,
},
Custom(T),
}
Expand description
The basic network events shipped with amethyst.
Variants
Connect
Fields
client_uuid: Uuid
The client uuid.
Ask to connect to the server.
Connected
Fields
server_uuid: Uuid
The server uuid.
Reply to the client that the connection has been accepted.
ConnectionRefused
Fields
reason: String
The reason of the refusal.
Reply to the client that the connection has been refused.
Disconnect
Fields
reason: String
The reason of the disconnection.
Tell the server that the client is disconnecting.
Disconnected
Fields
reason: String
The reason of the disconnection.
Notify the clients(including the one being disconnected) that a client has been disconnected from the server.
TextMessage
Fields
msg: String
The message.
A simple text message event.
Custom(T)
A user-defined type containing more network event types.
Implementations
Trait Implementations
sourceimpl<'de, T> Deserialize<'de> for NetEvent<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for NetEvent<T>where
T: Deserialize<'de>,
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<T: PartialEq> PartialEq<NetEvent<T>> for NetEvent<T>
impl<T: PartialEq> PartialEq<NetEvent<T>> for NetEvent<T>
impl<T> StructuralPartialEq for NetEvent<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for NetEvent<T>where
T: RefUnwindSafe,
impl<T> Send for NetEvent<T>where
T: Send,
impl<T> Sync for NetEvent<T>where
T: Sync,
impl<T> Unpin for NetEvent<T>where
T: Unpin,
impl<T> UnwindSafe for NetEvent<T>where
T: UnwindSafe,
Blanket Implementations
impl<T> Any for Twhere
T: Any,
impl<T> Any for Twhere
T: Any,
fn get_type_id(&self) -> TypeId
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more