diff --git a/rpc-toolkit/src/handler/from_fn.rs b/rpc-toolkit/src/handler/from_fn.rs index e3bec14..e9cf099 100644 --- a/rpc-toolkit/src/handler/from_fn.rs +++ b/rpc-toolkit/src/handler/from_fn.rs @@ -56,7 +56,10 @@ where } } -pub fn from_fn(function: F) -> FromFn { +pub fn from_fn(function: F) -> FromFn +where + FromFn: HandlerTypes, +{ FromFn { function, _phantom: PhantomData, @@ -65,7 +68,10 @@ pub fn from_fn(function: F) -> FromFn { } } -pub fn from_fn_blocking(function: F) -> FromFn { +pub fn from_fn_blocking(function: F) -> FromFn +where + FromFn: HandlerTypes, +{ FromFn { function, _phantom: PhantomData, @@ -104,7 +110,10 @@ where } } -pub fn from_fn_async(function: F) -> FromFnAsync { +pub fn from_fn_async(function: F) -> FromFnAsync +where + FromFnAsync: HandlerTypes, +{ FromFnAsync { function, _phantom: PhantomData,