pub trait Handler:
Sized
+ Send
+ 'static {
type Param: Param;
// Required method
fn prove<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(Vec<u8>, Vec<u8>), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
// Provided methods
fn viewable() -> bool { ... }
fn chain_accept<'life0, 'async_trait>(
_players: &'life0 [Player],
) -> Pin<Box<dyn Future<Output = Vec<u8>> + Send + 'async_trait>>
where 'life0: 'async_trait { ... }
fn chain_create<'life0, 'async_trait>(
_players: &'life0 [Player],
_params: Vec<u8>,
_rid: u64,
_seed: [u8; 32],
) -> Pin<Box<dyn Future<Output = Option<(Self, Vec<Box<dyn Task<H = Self>>>)>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait { ... }
fn pozk_create<'async_trait>(
_player: Player,
_params: Vec<u8>,
_rid: u64,
) -> Pin<Box<dyn Future<Output = Option<(Self, Vec<Box<dyn Task<H = Self>>>)>> + Send + 'async_trait>>
where Self: 'async_trait { ... }
fn pozk_join<'life0, 'async_trait>(
&'life0 mut self,
_player: Player,
_params: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<HandleResult<Self::Param>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait { ... }
fn viewer_online<'life0, 'async_trait>(
&'life0 mut self,
_peer: PeerId,
) -> Pin<Box<dyn Future<Output = Result<HandleResult<Self::Param>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait { ... }
fn viewer_offline<'life0, 'async_trait>(
&'life0 mut self,
_peer: PeerId,
) -> Pin<Box<dyn Future<Output = Result<HandleResult<Self::Param>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait { ... }
fn online<'life0, 'async_trait>(
&'life0 mut self,
_peer: PeerId,
) -> Pin<Box<dyn Future<Output = Result<HandleResult<Self::Param>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait { ... }
fn offline<'life0, 'async_trait>(
&'life0 mut self,
_peer: PeerId,
) -> Pin<Box<dyn Future<Output = Result<HandleResult<Self::Param>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait { ... }
fn handle<'life0, 'async_trait>(
&'life0 mut self,
_peer: PeerId,
_param: Self::Param,
) -> Pin<Box<dyn Future<Output = Result<HandleResult<Self::Param>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait { ... }
}
Expand description
Export useful types Handle message received from players
Required Associated Types§
Required Methods§
Provided Methods§
Sourcefn chain_accept<'life0, 'async_trait>(
_players: &'life0 [Player],
) -> Pin<Box<dyn Future<Output = Vec<u8>> + Send + 'async_trait>>where
'life0: 'async_trait,
fn chain_accept<'life0, 'async_trait>(
_players: &'life0 [Player],
) -> Pin<Box<dyn Future<Output = Vec<u8>> + Send + 'async_trait>>where
'life0: 'async_trait,
Accept params when submit to chain
Sourcefn chain_create<'life0, 'async_trait>(
_players: &'life0 [Player],
_params: Vec<u8>,
_rid: u64,
_seed: [u8; 32],
) -> Pin<Box<dyn Future<Output = Option<(Self, Vec<Box<dyn Task<H = Self>>>)>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn chain_create<'life0, 'async_trait>(
_players: &'life0 [Player],
_params: Vec<u8>,
_rid: u64,
_seed: [u8; 32],
) -> Pin<Box<dyn Future<Output = Option<(Self, Vec<Box<dyn Task<H = Self>>>)>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Create new room scan from chain
Sourcefn pozk_create<'async_trait>(
_player: Player,
_params: Vec<u8>,
_rid: u64,
) -> Pin<Box<dyn Future<Output = Option<(Self, Vec<Box<dyn Task<H = Self>>>)>> + Send + 'async_trait>>where
Self: 'async_trait,
fn pozk_create<'async_trait>(
_player: Player,
_params: Vec<u8>,
_rid: u64,
) -> Pin<Box<dyn Future<Output = Option<(Self, Vec<Box<dyn Task<H = Self>>>)>> + Send + 'async_trait>>where
Self: 'async_trait,
Create new room from PoZK
Sourcefn pozk_join<'life0, 'async_trait>(
&'life0 mut self,
_player: Player,
_params: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<HandleResult<Self::Param>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn pozk_join<'life0, 'async_trait>(
&'life0 mut self,
_player: Player,
_params: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<HandleResult<Self::Param>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
New player join from PoZK
Sourcefn viewer_online<'life0, 'async_trait>(
&'life0 mut self,
_peer: PeerId,
) -> Pin<Box<dyn Future<Output = Result<HandleResult<Self::Param>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn viewer_online<'life0, 'async_trait>(
&'life0 mut self,
_peer: PeerId,
) -> Pin<Box<dyn Future<Output = Result<HandleResult<Self::Param>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
New Viewer online if viewable is true
Sourcefn viewer_offline<'life0, 'async_trait>(
&'life0 mut self,
_peer: PeerId,
) -> Pin<Box<dyn Future<Output = Result<HandleResult<Self::Param>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn viewer_offline<'life0, 'async_trait>(
&'life0 mut self,
_peer: PeerId,
) -> Pin<Box<dyn Future<Output = Result<HandleResult<Self::Param>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
New Viewer offline if viewable is true
Sourcefn online<'life0, 'async_trait>(
&'life0 mut self,
_peer: PeerId,
) -> Pin<Box<dyn Future<Output = Result<HandleResult<Self::Param>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn online<'life0, 'async_trait>(
&'life0 mut self,
_peer: PeerId,
) -> Pin<Box<dyn Future<Output = Result<HandleResult<Self::Param>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
When player online
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.