Function spacetimedb_sdk::once_on_disconnect
source · pub fn once_on_disconnect(
callback: impl FnOnce() + Send + 'static
) -> DisconnectCallbackId
Expand description
Register a callback to be invoked when a connection ends.
The callback will be invoked after a connection closes,
either because of a call to disconnect
or because the server closed the connection.
The callback will be unregistered after running.
The returned DisconnectCallbackId
can be passed to remove_on_disconnect
to unregister the callback.