pub struct ClusterState { /* private fields */ }
Implementations§
Source§impl ClusterState
impl ClusterState
Sourcepub fn get_keyspace(&self, keyspace: impl AsRef<str>) -> Option<&Keyspace>
pub fn get_keyspace(&self, keyspace: impl AsRef<str>) -> Option<&Keyspace>
Access keyspace details collected by the driver.
Sourcepub fn keyspaces_iter(&self) -> impl Iterator<Item = (&str, &Keyspace)>
pub fn keyspaces_iter(&self) -> impl Iterator<Item = (&str, &Keyspace)>
Returns an iterator over keyspaces.
Sourcepub fn get_nodes_info(&self) -> &[Arc<Node>]
pub fn get_nodes_info(&self) -> &[Arc<Node>]
Access details about nodes known to the driver
Sourcepub fn compute_token(
&self,
keyspace: &str,
table: &str,
partition_key: &dyn SerializeRow,
) -> Result<Token, ClusterStateTokenError>
pub fn compute_token( &self, keyspace: &str, table: &str, partition_key: &dyn SerializeRow, ) -> Result<Token, ClusterStateTokenError>
Compute token of a table partition key
partition_key
argument contains the values of all partition key
columns. You can use both unnamed values like a tuple (e.g. (1, 5, 5)
)
or named values (e.g. struct that derives SerializeRow
), as you would
when executing a request. No additional values are allowed besides values
for primary key columns.
Sourcepub fn get_token_endpoints(
&self,
keyspace: &str,
table: &str,
token: Token,
) -> Vec<(Arc<Node>, Shard)>
pub fn get_token_endpoints( &self, keyspace: &str, table: &str, token: Token, ) -> Vec<(Arc<Node>, Shard)>
Access to replicas owning a given token
Sourcepub fn get_endpoints(
&self,
keyspace: &str,
table: &str,
partition_key: &dyn SerializeRow,
) -> Result<Vec<(Arc<Node>, Shard)>, ClusterStateTokenError>
pub fn get_endpoints( &self, keyspace: &str, table: &str, partition_key: &dyn SerializeRow, ) -> Result<Vec<(Arc<Node>, Shard)>, ClusterStateTokenError>
Access to replicas owning a given partition key (similar to nodetool getendpoints
)
partition_key
argument contains the values of all partition key
columns. You can use both unnamed values like a tuple (e.g. (1, 5, 5)
)
or named values (e.g. struct that derives SerializeRow
), as you would
when executing a request. No additional values are allowed besides values
for primary key columns.
Sourcepub fn replica_locator(&self) -> &ReplicaLocator
pub fn replica_locator(&self) -> &ReplicaLocator
Access replica location info
Trait Implementations§
Source§impl Clone for ClusterState
impl Clone for ClusterState
Source§fn clone(&self) -> ClusterState
fn clone(&self) -> ClusterState
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for ClusterState
impl !RefUnwindSafe for ClusterState
impl Send for ClusterState
impl Sync for ClusterState
impl Unpin for ClusterState
impl !UnwindSafe for ClusterState
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<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