pub struct Node {
pub host_id: Uuid,
pub address: NodeAddr,
pub datacenter: Option<String>,
pub rack: Option<String>,
/* private fields */
}Expand description
Node represents a cluster node along with its data and connections
Note: if a Node changes its broadcast address, then it is not longer represented by the same instance of Node struct, but instead a new instance is created (for implementation reasons).
Fields§
§host_id: UuidUnique identifier of the node.
address: NodeAddrAddress of the node, which is used to connect to it.
This address is either the one broadcast by the node itself
(NodeAddr::Translatable) or the one used to connect to it
in the first place if it’s a contact point (NodeAddr::Untranslatable).
datacenter: Option<String>Datacenter of the node, if known.
rack: Option<String>Rack of the node, if known.
Implementations§
Source§impl Node
impl Node
Sourcepub fn sharder(&self) -> Option<Sharder>
pub fn sharder(&self) -> Option<Sharder>
Retrieves the sharder for this node, if it has one.
If the node is disabled (i.e., it has no connection pool),
or the node is not sharded (i.e., it’s not a ScyllaDB node), this will return None.
If the node is enabled and does not have a sharder, this means it’s not a ScyllaDB node.
Sourcepub fn is_connected(&self) -> bool
pub fn is_connected(&self) -> bool
Returns true if the driver has any open connections in the pool for this node.
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Returns a boolean which indicates whether this node was is enabled. Only enabled nodes will have connections open. For disabled nodes, no connections will be opened.
Trait Implementations§
impl Eq for Node
Auto Trait Implementations§
impl Freeze for Node
impl RefUnwindSafe for Node
impl Send for Node
impl Sync for Node
impl Unpin for Node
impl UnsafeUnpin for Node
impl UnwindSafe for Node
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
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
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more