serf_core/
delegate.rs

1use memberlist_core::{transport::Id, CheapClone};
2
3mod merge;
4pub use merge::*;
5
6mod reconnect;
7pub use reconnect::*;
8
9mod transform;
10pub use transform::*;
11
12mod composite;
13pub use composite::*;
14
15/// [`Delegate`] is the trait that clients must implement if they want to hook
16/// into the gossip layer of [`Serf`](crate::Serf). All the methods must be thread-safe,
17/// as they can and generally will be called concurrently.
18pub trait Delegate:
19  MergeDelegate<Id = <Self as Delegate>::Id, Address = <Self as Delegate>::Address>
20  + TransformDelegate<Id = <Self as Delegate>::Id, Address = <Self as Delegate>::Address>
21  + ReconnectDelegate<Id = <Self as Delegate>::Id, Address = <Self as Delegate>::Address>
22{
23  /// The id type of the delegate
24  type Id: Id;
25  /// The address type of the delegate
26  type Address: CheapClone + Send + Sync + 'static;
27}