[−][src]Struct weasel::server::Server
The server is the main object used to orchestrate a battle.
A server owns all data of the battle and it can also process events. Events are the only way in
which a battle can be evolved; all battle data can be retrieved through immutable references.
Exactly one server is required in order to start a game.
One or more client sinks can be connected to a server, to receive verified events.
Implementations
impl<R: BattleRules + 'static> Server<R>
[src]
pub fn builder(battle: Battle<R>) -> ServerBuilder<R>
[src]
Returns a server builder.
pub fn authentication(&self) -> bool
[src]
Returns true if the client events authentication is enforced.
pub fn rights(&self) -> RightsHandle<'_, R>
[src]
Returns a handle to access the players' rights to control one or more teams.
pub fn rights_mut<'a>(
&'a mut self
) -> RightsHandleMut<'_, R, impl Iterator<Item = &'a TeamId<R>>>
[src]
&'a mut self
) -> RightsHandleMut<'_, R, impl Iterator<Item = &'a TeamId<R>>>
Returns a mutable handle to manage the players' rights to control one or more teams.
pub fn client_sinks(&self) -> MultiClientSinkHandle<'_, R>
[src]
Returns a handle to access the client sinks of this server.
pub fn client_sinks_mut(&mut self) -> MultiClientSinkHandleMut<'_, R>
[src]
Returns a mutable handle to manage the client sinks of this server.
Trait Implementations
impl<R: BattleRules> BattleController<R> for Server<R>
[src]
fn battle(&self) -> &Battle<R>
[src]
fn event_callback(&self) -> &Option<EventCallback<R>>
[src]
fn set_event_callback(&mut self, callback: Option<EventCallback<R>>)
[src]
impl<R: BattleRules + 'static> EventProcessor<R> for Server<R>
[src]
type ProcessOutput = WeaselResult<(), R>
Return type for this processor's process()
.
fn process(&mut self, event: EventPrototype<R>) -> Self::ProcessOutput
[src]
impl<R: BattleRules + 'static> EventReceiver<R> for Server<R>
[src]
fn receive(&mut self, event: VersionedEventWrapper<R>) -> WeaselResult<(), R>
[src]
impl<R: BattleRules + 'static> EventServer<R> for Server<R>
[src]
fn process_client(
&mut self,
event: ClientEventPrototype<R>
) -> WeaselResult<(), R>
[src]
&mut self,
event: ClientEventPrototype<R>
) -> WeaselResult<(), R>
Auto Trait Implementations
impl<R> !RefUnwindSafe for Server<R>
impl<R> Send for Server<R> where
<<R as BattleRules>::AR as ActorRules<R>>::Ability: Send,
<<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>::TR as TeamRules<R>>::Power 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>::TR as TeamRules<R>>::Power: 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: Send,
<<R as BattleRules>::CR as CharacterRules<R>>::Status: Send,
<<R as BattleRules>::UR as UserRules<R>>::UserMetricId: Send,
<<R as BattleRules>::AR as ActorRules<R>>::Ability: Send,
<<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>::TR as TeamRules<R>>::Power 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>::TR as TeamRules<R>>::Power: 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: Send,
<<R as BattleRules>::CR as CharacterRules<R>>::Status: Send,
<<R as BattleRules>::UR as UserRules<R>>::UserMetricId: Send,
impl<R> !Sync for Server<R>
impl<R> Unpin for Server<R> where
R: Unpin,
<<R as BattleRules>::AR as ActorRules<R>>::Ability: Unpin,
<<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>::TR as TeamRules<R>>::Power 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>::TR as TeamRules<R>>::Power: 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: Unpin,
<<R as BattleRules>::CR as CharacterRules<R>>::Status: Unpin,
<<R as BattleRules>::UR as UserRules<R>>::UserMetricId: Unpin,
R: Unpin,
<<R as BattleRules>::AR as ActorRules<R>>::Ability: Unpin,
<<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>::TR as TeamRules<R>>::Power 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>::TR as TeamRules<R>>::Power: 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: Unpin,
<<R as BattleRules>::CR as CharacterRules<R>>::Status: Unpin,
<<R as BattleRules>::UR as UserRules<R>>::UserMetricId: Unpin,
impl<R> !UnwindSafe for Server<R>
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,
pub 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.
pub 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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,