pub struct StaticDiscovery { /* private fields */ }Expand description
Static discovery using predefined node list
Implementations§
Source§impl StaticDiscovery
impl StaticDiscovery
Sourcepub fn new(nodes: Vec<ClusterNode>) -> Self
pub fn new(nodes: Vec<ClusterNode>) -> Self
Create a new static discovery service
Sourcepub fn add_node(&self, node: ClusterNode)
pub fn add_node(&self, node: ClusterNode)
Add a node to the static list
Sourcepub fn remove_node(&self, node_id: &str)
pub fn remove_node(&self, node_id: &str)
Remove a node from the static list
Trait Implementations§
Source§impl DiscoveryService for StaticDiscovery
impl DiscoveryService for StaticDiscovery
Source§fn discover_nodes<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<ClusterNode>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn discover_nodes<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<ClusterNode>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Discover nodes in the cluster
Source§fn register_node<'life0, 'async_trait>(
&'life0 self,
node: ClusterNode,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn register_node<'life0, 'async_trait>(
&'life0 self,
node: ClusterNode,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Register this node in the discovery service
Auto Trait Implementations§
impl Freeze for StaticDiscovery
impl !RefUnwindSafe for StaticDiscovery
impl Send for StaticDiscovery
impl Sync for StaticDiscovery
impl Unpin for StaticDiscovery
impl !UnwindSafe for StaticDiscovery
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