pub struct FunctionRegistry { /* private fields */ }Expand description
Keeps a mapping from FunctionType to stateful functions. Use this together with a
Transport to serve stateful functions.
Use register_fn() to register functions before handing the registry over to a Transport for
serving.
Implementations§
Source§impl FunctionRegistry
impl FunctionRegistry
Sourcepub fn new() -> FunctionRegistry
pub fn new() -> FunctionRegistry
Creates a new empty FunctionRegistry.
Sourcepub fn register_fn<I: Message, F: Fn(Context<'_>, I) -> Effects + Send + 'static>(
&mut self,
function_type: FunctionType,
function: F,
)
pub fn register_fn<I: Message, F: Fn(Context<'_>, I) -> Effects + Send + 'static>( &mut self, function_type: FunctionType, function: F, )
Registers the given function under the function_type.
Auto Trait Implementations§
impl Freeze for FunctionRegistry
impl !RefUnwindSafe for FunctionRegistry
impl Send for FunctionRegistry
impl !Sync for FunctionRegistry
impl Unpin for FunctionRegistry
impl UnsafeUnpin for FunctionRegistry
impl !UnwindSafe for FunctionRegistry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more