[−][src]Struct naia_client::NaiaClient
Client can send/receive events to/from a server, and has a pool of in-scope entities that are synced with the server
Implementations
impl<T: EventType, U: EntityType> NaiaClient<T, U>
[src]
pub fn new(
server_address: SocketAddr,
manifest: Manifest<T, U>,
config: Option<Config>,
auth: Option<T>
) -> Self
[src]
server_address: SocketAddr,
manifest: Manifest<T, U>,
config: Option<Config>,
auth: Option<T>
) -> Self
Create a new client, given the server's address, a shared manifest, an optional Config, and an optional Authentication event
pub fn receive(&mut self) -> Result<ClientEvent<T>, NaiaClientError>
[src]
Must be called regularly, performs updates to the connection, and retrieves event/entity updates sent by the Server
pub fn send_event(&mut self, event: &impl Event<T>)
[src]
Queues up an Event to be sent to the Server
pub fn server_address(&self) -> SocketAddr
[src]
Get the address currently associated with the Server
pub fn get_entity(&self, key: LocalEntityKey) -> Option<&U>
[src]
Get a reference to an Entity currently in scope for the Client, given that Entity's Key
pub fn get_rtt(&self) -> f32
[src]
Get the current measured Round Trip Time to the Server
Trait Implementations
impl<T: Debug + EventType, U: Debug + EntityType> Debug for NaiaClient<T, U>
[src]
Auto Trait Implementations
impl<T, U> !RefUnwindSafe for NaiaClient<T, U>
impl<T, U> !Send for NaiaClient<T, U>
impl<T, U> !Sync for NaiaClient<T, U>
impl<T, U> Unpin for NaiaClient<T, U> where
T: Unpin,
U: Unpin,
T: Unpin,
U: Unpin,
impl<T, U> !UnwindSafe for NaiaClient<T, U>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,