Expand description
§Warqueen
Hobby-scale small networking crate based on Quinn, message based, no async, no blocking.
- The server and the client are intended to run in a loop.
- They can poll received messages and events when they want, and send messages when they want.
- There is a message type for client-to-server messaging, and a message type for server-to-client messaging, and that is all. These two types can be enums to make up for that.
- Nya :3
Both the client code and server code are supposed to have vaguely the following structure:
ⓘ
let mut networking_stuff = ...;
loop {
while let Some(event) = poll_event(&mut networking_stuff) {
handle_event(event);
}
handle_other_networking_stuff(&mut networking_stuff);
// ...
}
Go see the examples, they are very simple, probably the best guide for Warqueen!
Also the README that is displayed on the crates.io page has somewhat of a usage guide.
Things to keep in mind:
- Do not use, lacks plenty of features.
- Beware the
DisconnectionHandle
s that are better waited for on the main thread (if you have multiple threads and disconnect from a thread other than the main thread). - Good luck out there!
Structs§
- Client
Networking - A connection to a server, from a client’s point of view.
- Client
OnServer Networking - A connection to a client, from a server’s point of view.
- Disconnection
Handle - A thingy that allows to make sure that a disconnection has the time to happen properly before process termination.
- Sending
State Handle - When a message is sent, it is sent asynchronously over a period. This handle allows to get to know if the message was really properly sent in the end or if something went wrong and what, the information is not available immediately.
- Server
Listener Networking - A piece of server networking that establishes connections to new clients
and provides these new clients (in the form of
ClientOnServerNetworking
s) when asked for.
Enums§
- Client
Disconnection Details - Details about a disconnection event
ClientEvent::Disconnected
. - Client
Event - Returned by
ClientNetworking::poll_event_from_server
. - Client
OnServer Disconnection Details - Details about a disconnection event
ClientOnServerEvent::Disconnected
. - Client
OnServer Event - Returned by
ClientOnServerNetworking::poll_event_from_client
. - Cloneless
Sending - Allows a sender to clonelessly send the content
T
as part of a message in the specific situation where: - Sending
Result - Was the message successfully sent, or did it fail (and why)?
- Sending
State - Has the message finished being sent? With what
SendingResult
?
Traits§
- NetReceive
- Message type that can be received from the network.
- NetSend
- Message type that can be sent through the network.
Derive Macros§
- NetReceive
- Implements the
NetReceive
trait. - NetSend
- Implements the
NetSend
trait.