[][src]Struct weasel::client::Client

pub struct Client<R: BattleRules> { /* fields omitted */ }

A client event processor.

Clients can accept any kind of event from a remote server. Local events are sent to the server to which the client is connected.

One or more client sinks can be connected to a client. Events received from the server are propagated to these sinks.

Implementations

impl<R: BattleRules + 'static> Client<R>[src]

pub fn builder(
    battle: Battle<R>,
    server_sink: Box<dyn ServerSink<R> + Send>
) -> ClientBuilder<R>
[src]

Returns a client builder.

pub fn authentication(&self) -> bool[src]

Returns whether or not client events authentication is enabled.

pub fn player(&self) -> &Option<PlayerId>[src]

Returns the player id associated to this client.

pub fn server_sink(&self) -> &(dyn ServerSink<R> + Send)[src]

Returns a reference to the server sink to which all event prototypes initiated by this client are sent.

pub fn set_server_sink(&mut self, sink: Box<dyn ServerSink<R> + Send>)[src]

Disconnects the current server sink and sets a new one.

pub fn client_sinks(&self) -> MultiClientSinkHandle<R>[src]

Returns a handle to access the client sinks of this client.

pub fn client_sinks_mut(&mut self) -> MultiClientSinkHandleMut<R>[src]

Returns a mutable handle to manage the client sinks of this client.

Trait Implementations

impl<R: BattleRules> BattleController<R> for Client<R>[src]

impl<R: BattleRules + 'static> EventProcessor<R> for Client<R>[src]

type ProcessOutput = WeaselResult<(), R>

Return type for this processor's process().

impl<R: BattleRules + 'static> EventReceiver<R> for Client<R>[src]

Auto Trait Implementations

impl<R> !RefUnwindSafe for Client<R>

impl<R> Send for Client<R> where
    <R as BattleRules>::AR: ActorRules<R>,
    <<R as BattleRules>::AR as ActorRules<R>>::Ability: Id + Send,
    <R as BattleRules>::CR: CharacterRules<R>,
    <<R as BattleRules>::CR as CharacterRules<R>>::CreatureId: Send,
    <R as BattleRules>::ER: Send,
    <<R as BattleRules>::ER as EntropyRules>::EntropyModel: Send,
    <<<R as BattleRules>::AR as ActorRules<R>>::Ability as Id>::Id: Send,
    <<<R as BattleRules>::CR as CharacterRules<R>>::Statistic as Id>::Id: Send,
    <<<R as BattleRules>::CR as CharacterRules<R>>::Status as Id>::Id: Send,
    <<R as BattleRules>::TR as TeamRules<R>>::Id: Send,
    <<R as BattleRules>::CR as CharacterRules<R>>::ObjectId: Send,
    <<R as BattleRules>::TR as TeamRules<R>>::Objectives: Send,
    <<R as BattleRules>::SR as SpaceRules<R>>::Position: Send,
    <R as BattleRules>::RR: Send,
    <<R as BattleRules>::RR as RoundsRules<R>>::RoundsModel: Send,
    <R as BattleRules>::SR: Send,
    <<R as BattleRules>::SR as SpaceRules<R>>::SpaceModel: Send,
    <<R as BattleRules>::CR as CharacterRules<R>>::Statistic: Id + Send,
    <<R as BattleRules>::CR as CharacterRules<R>>::Status: Id + Send,
    <R as BattleRules>::TR: TeamRules<R>,
    <R as BattleRules>::UR: UserRules<R>,
    <<R as BattleRules>::UR as UserRules<R>>::UserMetricId: Send

impl<R> !Sync for Client<R>

impl<R> Unpin for Client<R> where
    R: Unpin,
    <R as BattleRules>::AR: ActorRules<R>,
    <<R as BattleRules>::AR as ActorRules<R>>::Ability: Id + Unpin,
    <R as BattleRules>::CR: CharacterRules<R>,
    <<R as BattleRules>::CR as CharacterRules<R>>::CreatureId: Unpin,
    <R as BattleRules>::ER: Unpin,
    <<R as BattleRules>::ER as EntropyRules>::EntropyModel: Unpin,
    <<<R as BattleRules>::AR as ActorRules<R>>::Ability as Id>::Id: Unpin,
    <<<R as BattleRules>::CR as CharacterRules<R>>::Statistic as Id>::Id: Unpin,
    <<<R as BattleRules>::CR as CharacterRules<R>>::Status as Id>::Id: Unpin,
    <<R as BattleRules>::TR as TeamRules<R>>::Id: Unpin,
    <<R as BattleRules>::CR as CharacterRules<R>>::ObjectId: Unpin,
    <<R as BattleRules>::TR as TeamRules<R>>::Objectives: Unpin,
    <<R as BattleRules>::SR as SpaceRules<R>>::Position: Unpin,
    <R as BattleRules>::RR: Unpin,
    <<R as BattleRules>::RR as RoundsRules<R>>::RoundsModel: Unpin,
    <R as BattleRules>::SR: Unpin,
    <<R as BattleRules>::SR as SpaceRules<R>>::SpaceModel: Unpin,
    <<R as BattleRules>::CR as CharacterRules<R>>::Statistic: Id + Unpin,
    <<R as BattleRules>::CR as CharacterRules<R>>::Status: Id + Unpin,
    <R as BattleRules>::TR: TeamRules<R>,
    <R as BattleRules>::UR: UserRules<R>,
    <<R as BattleRules>::UR as UserRules<R>>::UserMetricId: Unpin

impl<R> !UnwindSafe for Client<R>

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,