pub enum PeerRingAction {
    None,
    SomeVNode(VirtualNode),
    Some(Did),
    RemoteAction(DidRemoteAction),
    MultiActions(Vec<PeerRingAction>),
}
Expand description

PeerRing use this to describe the result of Chord algorithm. Sometimes it’s a direct result, sometimes it’s an action that is continued externally.

Variants§

§

None

No result, the whole manipulation is done internally.

§

SomeVNode(VirtualNode)

Found some VirtualNode.

§

Some(Did)

Found some node.

§

RemoteAction(DidRemoteAction)

Trigger a remote action.

§

MultiActions(Vec<PeerRingAction>)

Trigger multiple remote actions.

Implementations§

Returns true if the action is a PeerRingAction::None value.

Returns true if the action is a PeerRingAction::Some value.

Returns true if the action is a PeerRingAction::RemoteAction value.

Returns true if the action is a PeerRingAction::MultiActions value.

Trait Implementations§

Join a ring containing a node identified by did. This method is usually invoked to maintain successor sequence and finger table after connect to another node.

This method will return a RemoteAction::FindSuccessorForConnect to the caller. The caller will send it to the node identified by did, and let the node find the successor of current node and make current node connect to that successor.

Find the successor of a Did. May return a remote action for the successor is recorded in another node.

Handle notification from a node that thinks it is the predecessor of current node. The did in parameters is the Did of that node. If that node is closer to current node or current node has no predecessor, set it to the did. This method will return that did if it is set to the predecessor.

Fix finger table by finding the successor for each finger. According to the paper, this method should be called periodically. According to the paper, only one finger should be fixed at a time.

called periodically. checks whether predecessor has failed.

Look up a VirtualNode by its Did. Always finds resource by finger table, ignoring the local cache. If the vid is between current node and its successor, its resource should be stored in current node.

Handle VNodeOperation if the target vnode between current node and the successor of current node, otherwise find the responsible node and return as Action.

When the successor of a node is updated, it needs to check if there are VirtualNodes that are no longer between current node and new_successor, and sync them to the new successor.

Cache fetched vnode locally.

Get vnode from local cache.

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

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

Calls U::from(self).

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

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more