Crate naia_shared
source · [−]Expand description
Naia Shared
Common functionality shared between naia-server & naia-client crates.
Re-exports
pub use naia_serde as serde;
Modules
Structs
Keeps track of sent & received packets, and contains ack information that is
copied into the standard header on each outgoing packet
Represents a connection to a remote host, and provides functionality to
manage the connection and the communications to it
Contains Config properties which will be used by a Server or Client
Represents a specific moment in time
Simple implementation of a store that manages a recycling pool of u16 keys
Contains configuration required to initialize a LinkConditioner
Handles incoming/outgoing messages, tracks the delivery status of Messages
so that guaranteed Messages can be re-transmitted to the remote host
Contains Config properties which will be used by a Server or Client
A Property of an Component/Message, that contains data
which must be tracked for updates
Container for cross-platform Random methods
Contains Config properties which will be shared by Server and Client
Contains Config properties which will be shared by Server and Client sockets
A Timer with a given duration after which it will enter into a “Ringing”
state. The Timer can be reset at an given time, or manually set to start
“Ringing” again.
Enums
Constants
The maximum of bytes that can be used for the payload of a given packet.
(See #38 of http://ithare.com/64-network-dos-and-donts-for-game-engines-part-v-udp/)
Traits
Represents a manager that must be notified when packets have been dropped or
delivered
Tracks which Properties have changed and need to be queued for syncing with
the Client
An Enum with a variant for every Component/Message that can be sent
between Client/Host
A struct that implements Replicate is a Message/Component, or otherwise,
a container of Properties that can be scoped, tracked, and synced, with a
remote host
The part of Replicate which is object-safe
Structures that implement the WorldMutType trait will be able to be loaded
into the Server at which point the Server will use this interface to keep
the WorldMutType in-sync with it’s own Entities/Components
Structures that implement the WorldMutType trait will be able to be loaded
into the Server at which point the Server will use this interface to keep
the WorldMutType in-sync with it’s own Entities/Components
Functions
Returns whether or not a wrapping number is greater than another
sequence_greater_than(2,1) will return true
sequence_greater_than(1,2) will return false
sequence_greater_than(1,1) will return false
Returns whether or not a wrapping number is greater than another
sequence_less_than(1,2) will return true
sequence_less_than(2,1) will return false
sequence_less_than(1,1) will return false
Retrieves the wrapping difference between 2 u16 values
wrapping_diff(1,2) will return 1
wrapping_diff(2,1) will return -1
wrapping_diff(65535,0) will return 1
wrapping_diff(0,65535) will return -1
Type Definitions
Attribute Macros
Derive Macros
Derives the Protocolize trait for a given enum
Derives the Replicate trait for a given struct