[][src]Struct weasel::event::MultiClientSinkHandleMut

pub struct MultiClientSinkHandleMut<'a, R> where
    R: BattleRules + 'static, 
{ /* fields omitted */ }

A structure to access and manipulate client sinks.

Methods

impl<'a, R> MultiClientSinkHandleMut<'a, R> where
    R: BattleRules + 'static, 
[src]

pub fn add_sink(&mut self, sink: Box<dyn ClientSink<R>>) -> WeaselResult<(), R>[src]

Adds a new sink.

Sinks must have unique ids.

pub fn add_sink_from(
    &mut self,
    sink: Box<dyn ClientSink<R>>,
    event_id: EventId
) -> WeaselResult<(), R>
[src]

Adds a new sink and shares the battle history with it, starting from the event having event_id up to the most recent event.

Sinks must have unique ids.

pub fn add_sink_range(
    &mut self,
    sink: Box<dyn ClientSink<R>>,
    range: Range<EventId>
) -> WeaselResult<(), R>
[src]

Adds a new sink and shares a portion of the battle history with it. More precisely, only the events inside range will be sent to the sink.

Sinks must have unique ids.

pub fn send_range(
    &mut self,
    id: EventSinkId,
    range: Range<EventId>
) -> WeaselResult<(), R>
[src]

Sends a range of events from the battle history to the sink with the given id.

pub fn remove_sink(&mut self, id: EventSinkId)[src]

Removes the sink with the given id.

pub fn sinks(&self) -> impl Iterator<Item = &Box<dyn ClientSink<R>>>[src]

Returns an iterator over all sinks.

Auto Trait Implementations

impl<'a, R> !RefUnwindSafe for MultiClientSinkHandleMut<'a, R>

impl<'a, R> !Send for MultiClientSinkHandleMut<'a, R>

impl<'a, R> !Sync for MultiClientSinkHandleMut<'a, R>

impl<'a, R> Unpin for MultiClientSinkHandleMut<'a, R>

impl<'a, R> !UnwindSafe for MultiClientSinkHandleMut<'a, 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>,