Struct cluster_mode::RestClusterNode[][src]

pub struct RestClusterNode { /* fields omitted */ }

An implementation of almost_raft::Node

RestClusterNode uses REST API to communicate with other cluster nodes. User of the crate must provide the following endpoints

  • /cluster/raft/request-vote/{requester_node_id:string}/{term:uint32}
  • /cluster/raft/vote/{term:uint32}/{true|false}
  • /cluster/raft/beat/{leader_node_id:string}/{term:uint32}

Implementations

impl RestClusterNode[src]

pub fn new(node_id: String, instance: ServiceInstance) -> Self[src]

Create new instance

Arguments

  • node_id - Unique identifier, better be UUID
  • instance - ServiceInstance of the node

pub fn service_instance(&self) -> &ServiceInstance[src]

Get the instance represented by discovery service

Trait Implementations

impl Clone for RestClusterNode[src]

impl Debug for RestClusterNode[src]

impl Eq for RestClusterNode[src]

impl Hash for RestClusterNode[src]

impl Node for RestClusterNode[src]

type NodeType = RestClusterNode

concrete node type

impl PartialEq<RestClusterNode> for RestClusterNode[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,