[][src]Trait weasel::user::UserEventPacker

pub trait UserEventPacker<R>: Serialize + for<'a> Deserialize<'a> where
    R: BattleRules
{ fn boxed(self) -> WeaselResult<Box<dyn Event<R> + Send>, R>;
fn flattened(event: Box<dyn Event<R> + Send>) -> WeaselResult<Self, R>; }

Stores one user event payload and manages its serialization/deserialization.

Required methods

fn boxed(self) -> WeaselResult<Box<dyn Event<R> + Send>, R>

Returns a boxed trait object version of this packed user event.

Returns an error if the conversion failed.

fn flattened(event: Box<dyn Event<R> + Send>) -> WeaselResult<Self, R>

Returns a UserEventPacker corresponding to the user event contained inside event.

Fails if event is not an user event or if the conversion failed.

Loading content...

Implementations on Foreign Types

impl<R> UserEventPacker<R> for () where
    R: BattleRules
[src]

Loading content...

Implementors

Loading content...