Trait MergeDelegate

Source
pub trait MergeDelegate:
    Send
    + Sync
    + 'static {
    type Error: Error + Send + Sync + 'static;
    type Id: Id;
    type Address: CheapClone + Send + Sync + 'static;

    // Required method
    fn notify_merge(
        &self,
        members: Arc<[Member<Self::Id, Self::Address>]>,
    ) -> impl Future<Output = Result<(), Self::Error>> + Send;
}
Expand description

Used to involve a client in a potential cluster merge operation. Namely, when a node does a promised push/pull (as part of a join), the delegate is involved and allowed to cancel the join based on custom logic. The merge delegate is NOT invoked as part of the push-pull anti-entropy.

Required Associated Types§

Source

type Error: Error + Send + Sync + 'static

The error type of the delegate

Source

type Id: Id

The id type of the delegate

Source

type Address: CheapClone + Send + Sync + 'static

The address type of the delegate

Required Methods§

Source

fn notify_merge( &self, members: Arc<[Member<Self::Id, Self::Address>]>, ) -> impl Future<Output = Result<(), Self::Error>> + Send

Invoked when a merge could take place. Provides a list of the nodes known by the peer. If the return value is Err, the merge is canceled.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T: MergeDelegate + ?Sized> MergeDelegate for Box<T>
where Box<T>: Send + Sync + 'static,

Source§

type Error = <T as MergeDelegate>::Error

Source§

type Id = <T as MergeDelegate>::Id

Source§

type Address = <T as MergeDelegate>::Address

Source§

fn notify_merge( &self, members: Arc<[Member<Self::Id, Self::Address>]>, ) -> impl Future<Output = Result<(), Self::Error>> + Send

Source§

impl<T: MergeDelegate + ?Sized> MergeDelegate for Arc<T>
where Arc<T>: Send + Sync + 'static,

Source§

type Error = <T as MergeDelegate>::Error

Source§

type Id = <T as MergeDelegate>::Id

Source§

type Address = <T as MergeDelegate>::Address

Source§

fn notify_merge( &self, members: Arc<[Member<Self::Id, Self::Address>]>, ) -> impl Future<Output = Result<(), Self::Error>> + Send

Implementors§

Source§

impl<I, A> MergeDelegate for DefaultMergeDelegate<I, A>
where I: Id + Send + Sync + 'static, A: CheapClone + Send + Sync + 'static,

Source§

impl<I, A, M, R> MergeDelegate for CompositeDelegate<I, A, M, R>
where I: Id + Send + Sync + 'static, A: CheapClone + Send + Sync + 'static, M: MergeDelegate<Id = I, Address = A>, R: Send + Sync + 'static,