pub trait Kitsune:
'static
+ Send
+ Sync
+ Debug {
// Required methods
fn register_handler(
&self,
handler: DynKitsuneHandler,
) -> BoxFut<'_, K2Result<()>>;
fn space(&self, space: SpaceId) -> BoxFut<'_, K2Result<DynSpace>>;
}Expand description
The top-level Kitsune2 api trait.
Required Methods§
Sourcefn register_handler(
&self,
handler: DynKitsuneHandler,
) -> BoxFut<'_, K2Result<()>>
fn register_handler( &self, handler: DynKitsuneHandler, ) -> BoxFut<'_, K2Result<()>>
Register the kitsune handler exactly once before invoking any other api functions.
This dependency injection strategy makes it possible for a struct to both act as a Handler and contain the resulting Kitsune instance.
Implementations should error if this is invoked more that once, and should return errors for any other api invocations if this has not yet been called.