pub struct NodeServer { /* private fields */ }Implementations§
Source§impl NodeServer
impl NodeServer
pub fn new(node: Node, config: Config) -> Self
pub fn get_successor(&self) -> Node
pub fn get_successor_list(&self) -> Vec<Node>
pub fn set_successor_list(&self, succ_list: Vec<Node>)
pub fn get_predecessor(&self) -> Option<Node>
pub fn set_predecessor(&self, node: Option<Node>)
Sourcepub async fn start(
&mut self,
join_node: Option<Node>,
) -> DhtResult<ServerManager>
pub async fn start( &mut self, join_node: Option<Node>, ) -> DhtResult<ServerManager>
Start the server Returns if the listener starts
pub fn finger_table_start(&self, k: usize) -> u64
Sourcepub fn remove_connection(&self, node: &Node)
pub fn remove_connection(&self, node: &Node)
Remove broken connections
pub async fn join(&mut self, node: &Node) -> DhtResult<()>
pub async fn stabilize(&mut self)
pub async fn fix_finger(&mut self, index: usize)
Trait Implementations§
Source§impl Clone for NodeServer
impl Clone for NodeServer
Source§fn clone(&self) -> NodeServer
fn clone(&self) -> NodeServer
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl NodeService for NodeServer
impl NodeService for NodeServer
Source§type GetNodeRpcFut = Pin<Box<dyn Future<Output = Node> + Send>>
type GetNodeRpcFut = Pin<Box<dyn Future<Output = Node> + Send>>
The response future returned by
NodeService::get_node_rpc.Source§type GetPredecessorRpcFut = Pin<Box<dyn Future<Output = Option<Node>> + Send>>
type GetPredecessorRpcFut = Pin<Box<dyn Future<Output = Option<Node>> + Send>>
The response future returned by
NodeService::get_predecessor_rpc.Source§type GetSuccessorRpcFut = Pin<Box<dyn Future<Output = Node> + Send>>
type GetSuccessorRpcFut = Pin<Box<dyn Future<Output = Node> + Send>>
The response future returned by
NodeService::get_successor_rpc.Source§type GetSuccessorListRpcFut = Pin<Box<dyn Future<Output = Vec<Node>> + Send>>
type GetSuccessorListRpcFut = Pin<Box<dyn Future<Output = Vec<Node>> + Send>>
The response future returned by
NodeService::get_successor_list_rpc.Source§type FindSuccessorListRpcFut = Pin<Box<dyn Future<Output = Vec<Node>> + Send>>
type FindSuccessorListRpcFut = Pin<Box<dyn Future<Output = Vec<Node>> + Send>>
The response future returned by
NodeService::find_successor_list_rpc.Source§type FindPredecessorRpcFut = Pin<Box<dyn Future<Output = Node> + Send>>
type FindPredecessorRpcFut = Pin<Box<dyn Future<Output = Node> + Send>>
The response future returned by
NodeService::find_predecessor_rpc.Source§type ClosestPrecedingFingerRpcFut = Pin<Box<dyn Future<Output = Node> + Send>>
type ClosestPrecedingFingerRpcFut = Pin<Box<dyn Future<Output = Node> + Send>>
The response future returned by
NodeService::closest_preceding_finger_rpc.Source§type NotifyRpcFut = Pin<Box<dyn Future<Output = ()> + Send>>
type NotifyRpcFut = Pin<Box<dyn Future<Output = ()> + Send>>
The response future returned by
NodeService::notify_rpc.Source§type StabilizeRpcFut = Pin<Box<dyn Future<Output = ()> + Send>>
type StabilizeRpcFut = Pin<Box<dyn Future<Output = ()> + Send>>
The response future returned by
NodeService::stabilize_rpc.Source§type GetLocalRpcFut = Pin<Box<dyn Future<Output = Option<Vec<u8>>> + Send>>
type GetLocalRpcFut = Pin<Box<dyn Future<Output = Option<Vec<u8>>> + Send>>
The response future returned by
NodeService::get_local_rpc.Source§type SetLocalRpcFut = Pin<Box<dyn Future<Output = ()> + Send>>
type SetLocalRpcFut = Pin<Box<dyn Future<Output = ()> + Send>>
The response future returned by
NodeService::set_local_rpc.Source§type GetRpcFut = Pin<Box<dyn Future<Output = Option<Vec<u8>>> + Send>>
type GetRpcFut = Pin<Box<dyn Future<Output = Option<Vec<u8>>> + Send>>
The response future returned by
NodeService::get_rpc.Source§type SetRpcFut = Pin<Box<dyn Future<Output = ()> + Send>>
type SetRpcFut = Pin<Box<dyn Future<Output = ()> + Send>>
The response future returned by
NodeService::set_rpc.Source§type ReplicateRpcFut = Pin<Box<dyn Future<Output = ()> + Send>>
type ReplicateRpcFut = Pin<Box<dyn Future<Output = ()> + Send>>
The response future returned by
NodeService::replicate_rpc.fn get_node_rpc(self, _: Context) -> Pin<Box<dyn Future<Output = Node> + Send>>
fn get_predecessor_rpc( self, _: Context, ) -> Pin<Box<dyn Future<Output = Option<Node>> + Send>>
fn get_successor_rpc( self, _: Context, ) -> Pin<Box<dyn Future<Output = Node> + Send>>
fn get_successor_list_rpc( self, _: Context, ) -> Pin<Box<dyn Future<Output = Vec<Node>> + Send>>
fn find_successor_list_rpc( self, _: Context, id: Digest, ) -> Pin<Box<dyn Future<Output = Vec<Node>> + Send>>
fn find_predecessor_rpc( self, _: Context, id: Digest, ) -> Pin<Box<dyn Future<Output = Node> + Send>>
fn closest_preceding_finger_rpc( self, _: Context, id: Digest, ) -> Pin<Box<dyn Future<Output = Node> + Send>>
fn notify_rpc( self, _: Context, node: Node, ) -> Pin<Box<dyn Future<Output = ()> + Send>>
fn stabilize_rpc(self, _: Context) -> Pin<Box<dyn Future<Output = ()> + Send>>
fn get_local_rpc( self, _: Context, key: Key, ) -> Pin<Box<dyn Future<Output = Option<Value>> + Send>>
fn set_local_rpc( self, _: Context, key: Key, value: Option<Value>, ) -> Pin<Box<dyn Future<Output = ()> + Send>>
fn get_rpc( self, _: Context, key: Key, ) -> Pin<Box<dyn Future<Output = Option<Value>> + Send>>
fn set_rpc( self, _: Context, key: Key, value: Option<Value>, ) -> Pin<Box<dyn Future<Output = ()> + Send>>
fn replicate_rpc( self, _: Context, key: Key, value: Option<Value>, ) -> Pin<Box<dyn Future<Output = ()> + Send>>
Source§fn serve(self) -> ServeNodeService<Self>
fn serve(self) -> ServeNodeService<Self>
Returns a serving function to use with
InFlightRequest::execute.
Auto Trait Implementations§
impl Freeze for NodeServer
impl RefUnwindSafe for NodeServer
impl Send for NodeServer
impl Sync for NodeServer
impl Unpin for NodeServer
impl UnsafeUnpin for NodeServer
impl UnwindSafe for NodeServer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more