[][src]Struct naia_client::NaiaClient

pub struct NaiaClient<T: EventType, U: EntityType> { /* fields omitted */ }

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]

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

impl<T, U> !UnwindSafe for NaiaClient<T, U>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.