pub trait DynAccessControl:
Debug
+ Send
+ Sync
+ 'static {
// Required methods
fn on_connect<'a>(
&'a self,
request: &'a ClientRequest,
) -> Pin<Box<dyn Future<Output = Access> + Send + 'a>>;
fn on_disconnect(
&self,
endpoint_id: EndpointId,
connection_id: ConnectionId,
);
}Available on crate feature
server only.Expand description
A dyn-compatible version of AccessControl that returns boxed futures.
Any type that implements AccessControl automatically implements
DynAccessControl. Wrap it in an Arc to store it as an
Arc<dyn DynAccessControl>, for example in RelayConfig::access.