pub trait PrefabFunctions<'a, Arg: Send + 'a>: Sized + 'a {
type UserLevelInputFunction: Send + 'a;
type SharedBundle: Send + 'a;
// Required methods
fn get_shared_bundle(&self) -> Self::SharedBundle;
fn on_c2s_channel_received<'async_trait>(
connect_success: ConnectionSuccess,
remote: ClientServerRemote,
arg: Arg,
fx: Self::UserLevelInputFunction,
shared: Self::SharedBundle,
) -> Pin<Box<dyn Future<Output = Result<(), NetworkError>> + Send + 'async_trait>>
where Self: 'async_trait;
fn construct(kernel: Box<dyn NetKernel + 'a>) -> Self;
// Provided method
fn new(
server_connection_settings: ServerConnectionSettings,
arg: Arg,
on_channel_received: Self::UserLevelInputFunction,
) -> Self { ... }
}
Required Associated Types§
type UserLevelInputFunction: Send + 'a
Shared between the kernel and the on_c2s_channel_received function
Required Methods§
fn on_c2s_channel_received<'async_trait>(
connect_success: ConnectionSuccess,
remote: ClientServerRemote,
arg: Arg,
fx: Self::UserLevelInputFunction,
shared: Self::SharedBundle,
) -> Pin<Box<dyn Future<Output = Result<(), NetworkError>> + Send + 'async_trait>>where
Self: 'async_trait,
fn construct(kernel: Box<dyn NetKernel + 'a>) -> Self
Provided Methods§
sourcefn new(
server_connection_settings: ServerConnectionSettings,
arg: Arg,
on_channel_received: Self::UserLevelInputFunction,
) -> Self
fn new( server_connection_settings: ServerConnectionSettings, arg: Arg, on_channel_received: Self::UserLevelInputFunction, ) -> Self
Creates a new connection with a central server entailed by the user information
Object Safety§
This trait is not object safe.