pub enum NodeTarget {
Default,
Single(String),
Multiple(Vec<String>),
}Expand description
Represents a target node or set of nodes for API operations
Variants§
Default
No specific target - use the connected endpoint
Single(String)
Target a single node by IP or hostname
Multiple(Vec<String>)
Target multiple nodes (for cluster-wide operations)
Implementations§
Source§impl NodeTarget
impl NodeTarget
Sourcepub fn multiple(nodes: impl IntoIterator<Item = impl Into<String>>) -> Self
pub fn multiple(nodes: impl IntoIterator<Item = impl Into<String>>) -> Self
Create a target for multiple nodes
Sourcepub fn is_default(&self) -> bool
pub fn is_default(&self) -> bool
Check if this is the default target
Sourcepub fn is_multiple(&self) -> bool
pub fn is_multiple(&self) -> bool
Check if this targets multiple nodes
Sourcepub fn apply_to_request<T>(&self, request: Request<T>) -> Request<T>
pub fn apply_to_request<T>(&self, request: Request<T>) -> Request<T>
Apply node targeting to a gRPC request
Trait Implementations§
Source§impl Clone for NodeTarget
impl Clone for NodeTarget
Source§fn clone(&self) -> NodeTarget
fn clone(&self) -> NodeTarget
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NodeTarget
impl Debug for NodeTarget
Source§impl Default for NodeTarget
impl Default for NodeTarget
Source§fn default() -> NodeTarget
fn default() -> NodeTarget
Returns the “default value” for a type. Read more
Source§impl From<&str> for NodeTarget
impl From<&str> for NodeTarget
Source§impl From<String> for NodeTarget
impl From<String> for NodeTarget
Source§impl PartialEq for NodeTarget
impl PartialEq for NodeTarget
impl Eq for NodeTarget
impl StructuralPartialEq for NodeTarget
Auto Trait Implementations§
impl Freeze for NodeTarget
impl RefUnwindSafe for NodeTarget
impl Send for NodeTarget
impl Sync for NodeTarget
impl Unpin for NodeTarget
impl UnwindSafe for NodeTarget
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request