#[non_exhaustive]pub enum NodeAddr {
Translatable(SocketAddr),
Untranslatable(SocketAddr),
}
Expand description
This enum is introduced to support address translation only upon opening a connection,
as well as to cope with a bug present in older Cassandra and ScyllaDB releases.
The bug involves misconfiguration of rpc_address and/or broadcast_rpc_address
in system.local to 0.0.0.0. Mitigation involves replacing the faulty address
with connection’s address, but then that address must not be subject to AddressTranslator
,
so we carry that information using this enum. Address translation is never performed
on Untranslatable
variant.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Translatable(SocketAddr)
Fetched in Metadata with query_peers()
(broadcast by a node itself).
Untranslatable(SocketAddr)
Built from control connection’s address upon query_peers()
in order to mitigate the bug described above.
Implementations§
Source§impl NodeAddr
impl NodeAddr
Sourcepub fn ip(&self) -> IpAddr
pub fn ip(&self) -> IpAddr
IP address of the node.
Keep in mind that this discards the information about whether the address is translatable or not.
Don’t be surprised if you get a Translatable
address here and won’t be able to reach a node using it,
because the node might be reachable through a different address, which must be obtained by translation.
Trait Implementations§
Source§impl Ord for NodeAddr
impl Ord for NodeAddr
Source§impl PartialOrd for NodeAddr
impl PartialOrd for NodeAddr
impl Copy for NodeAddr
impl Eq for NodeAddr
impl StructuralPartialEq for NodeAddr
Auto Trait Implementations§
impl Freeze for NodeAddr
impl RefUnwindSafe for NodeAddr
impl Send for NodeAddr
impl Sync for NodeAddr
impl Unpin for NodeAddr
impl UnwindSafe for NodeAddr
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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