citadel_sdk::prefabs::client

Trait PrefabFunctions

source
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§

source

type UserLevelInputFunction: Send + 'a

source

type SharedBundle: Send + 'a

Shared between the kernel and the on_c2s_channel_received function

Required Methods§

source

fn get_shared_bundle(&self) -> Self::SharedBundle

source

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,

source

fn construct(kernel: Box<dyn NetKernel + 'a>) -> Self

Provided Methods§

source

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.

Implementors§