pub trait KitsuneHandler:
'static
+ Send
+ Sync
+ Debug {
// Required method
fn create_space(
&self,
space_id: SpaceId,
config_override: Option<&Config>,
) -> BoxFut<'_, K2Result<DynSpaceHandler>>;
// Provided methods
fn new_listening_address(&self, this_url: Url) -> BoxFut<'static, ()> { ... }
fn peer_disconnect(&self, peer: Url, reason: Option<String>) { ... }
fn preflight_gather_outgoing(
&self,
peer_url: Url,
) -> BoxFut<'_, K2Result<Bytes>> { ... }
fn preflight_validate_incoming(
&self,
peer_url: Url,
data: Bytes,
) -> BoxFut<'_, K2Result<()>> { ... }
}Expand description
Handler for events coming out of Kitsune2.
Required Methods§
Sourcefn create_space(
&self,
space_id: SpaceId,
config_override: Option<&Config>,
) -> BoxFut<'_, K2Result<DynSpaceHandler>>
fn create_space( &self, space_id: SpaceId, config_override: Option<&Config>, ) -> BoxFut<'_, K2Result<DynSpaceHandler>>
Creates a space handler for the given space.
Optionally, override configuration values for this space.
Provided Methods§
Sourcefn new_listening_address(&self, this_url: Url) -> BoxFut<'static, ()>
fn new_listening_address(&self, this_url: Url) -> BoxFut<'static, ()>
A notification that a new listening address has been bound. Peers should now go to this new address to reach this node.
Sourcefn peer_disconnect(&self, peer: Url, reason: Option<String>)
fn peer_disconnect(&self, peer: Url, reason: Option<String>)
A peer has disconnected from us. If they did so gracefully the reason will be is_some().