pub trait EventDelegate:
Send
+ Sync
+ 'static {
type Id: Id;
type Address: CheapClone + Send + Sync + 'static;
// Required methods
fn notify_join(
&self,
node: Arc<NodeState<Self::Id, Self::Address>>,
) -> impl Future<Output = ()> + Send;
fn notify_leave(
&self,
node: Arc<NodeState<Self::Id, Self::Address>>,
) -> impl Future<Output = ()> + Send;
fn notify_update(
&self,
node: Arc<NodeState<Self::Id, Self::Address>>,
) -> impl Future<Output = ()> + Send;
}Expand description
A simpler delegate that is used only to receive notifications about members joining and leaving. The methods in this delegate may be called by multiple threads, but never concurrently. This allows you to reason about ordering.
Required Associated Types§
Sourcetype Address: CheapClone + Send + Sync + 'static
type Address: CheapClone + Send + Sync + 'static
The address type of the delegate
Required Methods§
Sourcefn notify_join(
&self,
node: Arc<NodeState<Self::Id, Self::Address>>,
) -> impl Future<Output = ()> + Send
fn notify_join( &self, node: Arc<NodeState<Self::Id, Self::Address>>, ) -> impl Future<Output = ()> + Send
Invoked when a node is detected to have joined the cluster
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".