pub trait CallableParam<Ctx, Init>:
Send
+ Sync
+ Sized {
type Error: Error + Send;
// Required method
fn extract(
ctx: &mut Ctx,
init: &Init,
) -> impl Future<Output = Result<Self, Self::Error>> + Send + Sync;
}Expand description
A parameter that could appear in a callable function (e.g. rpc or on_connect).
This trait is used to extract the parameter from the context and/or initialize it from parameters used to create the callable function.
Required Associated Types§
Required Methods§
fn extract( ctx: &mut Ctx, init: &Init, ) -> impl Future<Output = Result<Self, Self::Error>> + Send + Sync
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.
Implementors§
Source§impl<Ctx, Init> CallableParam<Ctx, Init> for Users
impl<Ctx, Init> CallableParam<Ctx, Init> for Users
type Error = Infallible
Source§impl<Ctx: CallableFetch<App>, Init: Send + Sync> CallableParam<Ctx, Init> for App
impl<Ctx: CallableFetch<App>, Init: Send + Sync> CallableParam<Ctx, Init> for App
type Error = Infallible
Source§impl<Ctx: CallableFetch<User>, Init: Send + Sync> CallableParam<Ctx, Init> for User
impl<Ctx: CallableFetch<User>, Init: Send + Sync> CallableParam<Ctx, Init> for User
type Error = Infallible
Source§impl<T: StoreData, Ctx: CallableFetch<App> + Send + Sync, Init: Send + Sync> CallableParam<Ctx, Init> for Store<T>
Implement CallableParam for Store<T> to allow it to be used as a parameter in async
AND sync callables (e.g. crate::rpc methods, crate::AppBuilder::on_connect handlers,
etc).
impl<T: StoreData, Ctx: CallableFetch<App> + Send + Sync, Init: Send + Sync> CallableParam<Ctx, Init> for Store<T>
Implement CallableParam for Store<T> to allow it to be used as a parameter in async
AND sync callables (e.g. crate::rpc methods, crate::AppBuilder::on_connect handlers,
etc).