Skip to main content

VoidDelegate

Struct VoidDelegate 

Source
pub struct VoidDelegate<I, A>(/* private fields */);
Expand description

Void delegate

Implementations§

Source§

impl<I, A> VoidDelegate<I, A>

Source

pub const fn new() -> Self

Creates a new VoidDelegate.

Trait Implementations§

Source§

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

Source§

type Error = VoidDelegateError

The error type of the delegate
Source§

type Id = I

The id type of the delegate
Source§

type Address = A

The address type of the delegate
Source§

async fn notify_alive( &self, _peer: Arc<NodeState<Self::Id, Self::Address>>, ) -> Result<(), Self::Error>

Invoked when a message about a live node is received from the network. Returning a non-nil error prevents the node from being considered a peer.
Source§

impl<I: Clone, A: Clone> Clone for VoidDelegate<I, A>

Source§

fn clone(&self) -> VoidDelegate<I, A>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

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

Source§

type Id = I

The id type of the delegate
Source§

type Address = A

The address type of the delegate
Source§

async fn notify_conflict( &self, _existing: Arc<NodeState<Self::Id, Self::Address>>, _other: Arc<NodeState<Self::Id, Self::Address>>, )

Invoked when a name conflict is detected
Source§

impl<I: Copy, A: Copy> Copy for VoidDelegate<I, A>

Source§

impl<I: Debug, A: Debug> Debug for VoidDelegate<I, A>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<I, A> Default for VoidDelegate<I, A>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

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

Source§

type Id = I

The id type of the delegate
Source§

type Address = A

The address type of the delegate
Source§

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

Source§

type Id = I

The id type of the delegate
Source§

type Address = A

The address type of the delegate
Source§

async fn notify_join(&self, _node: Arc<NodeState<Self::Id, Self::Address>>)

Invoked when a node is detected to have joined the cluster
Source§

async fn notify_leave(&self, _node: Arc<NodeState<Self::Id, Self::Address>>)

Invoked when a node is detected to have left the cluster
Source§

async fn notify_update(&self, _node: Arc<NodeState<Self::Id, Self::Address>>)

Invoked when a node is detected to have updated, usually involving the meta data.
Source§

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

Source§

type Error = VoidDelegateError

The error type of the delegate
Source§

type Id = I

The id type of the delegate
Source§

type Address = A

The address type of the delegate
Source§

async fn notify_merge( &self, _peers: Arc<[NodeState<Self::Id, Self::Address>]>, ) -> Result<(), Self::Error>

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.
Source§

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

Source§

async fn node_meta(&self, _limit: usize) -> Meta

Used to retrieve meta-data about the current node when broadcasting an alive message. It’s length is limited to the given byte size. This metadata is available in the NodeState structure.
Source§

async fn notify_message(&self, _msg: Cow<'_, [u8]>)

Called when a user-data message is received. Care should be taken that this method does not block, since doing so would block the entire UDP packet receive loop. Additionally, the byte slice may be modified after the call returns, so it should be copied if needed
Source§

async fn broadcast_messages<F>( &self, _limit: usize, _encoded_len: F, ) -> impl Iterator<Item = Bytes> + Send
where F: Fn(Bytes) -> (usize, Bytes) + Send,

Called when user data messages can be broadcast. It can return a list of buffers to send. Each buffer should assume an overhead as provided with a limit on the total byte size allowed. The total byte size of the resulting data to send must not exceed the limit. Care should be taken that this method does not block, since doing so would block the entire UDP packet receive loop. Read more
Source§

async fn local_state(&self, _join: bool) -> Bytes

Used for a TCP Push/Pull. This is sent to the remote side in addition to the membership information. Any data can be sent here. See merge_remote_state as well. The join boolean indicates this is for a join instead of a push/pull.
Source§

async fn merge_remote_state(&self, _buf: &[u8], _join: bool)

Invoked after a TCP Push/Pull. This is the state received from the remote side and is the result of the remote side’s local_state call. The ‘join’ boolean indicates this is for a join instead of a push/pull.
Source§

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

Source§

type Id = I

The id type of the delegate
Source§

type Address = A

The address type of the delegate
Source§

async fn ack_payload(&self) -> Bytes

Invoked when an ack is being sent; the returned bytes will be appended to the ack
Source§

async fn notify_ping_complete( &self, _node: Arc<NodeState<Self::Id, Self::Address>>, _rtt: Duration, _payload: Bytes, )

Invoked when an ack for a ping is received
Source§

fn disable_reliable_pings(&self, _target: &Self::Id) -> bool

Invoked when we want to send a ping message to target by promised connection. Return true if the target node does not expect ping message from promised connection.

Auto Trait Implementations§

§

impl<I, A> Freeze for VoidDelegate<I, A>

§

impl<I, A> RefUnwindSafe for VoidDelegate<I, A>

§

impl<I, A> Send for VoidDelegate<I, A>
where I: Send, A: Send,

§

impl<I, A> Sync for VoidDelegate<I, A>
where I: Sync, A: Sync,

§

impl<I, A> Unpin for VoidDelegate<I, A>
where I: Unpin, A: Unpin,

§

impl<I, A> UnsafeUnpin for VoidDelegate<I, A>

§

impl<I, A> UnwindSafe for VoidDelegate<I, A>
where I: UnwindSafe, A: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more