Struct quilkin::net::cluster::ClusterMap
source · pub struct ClusterMap<S = RandomState> { /* private fields */ }
Expand description
Represents a full snapshot of all clusters.
Implementations§
source§impl ClusterMap<RandomState>
impl ClusterMap<RandomState>
source§impl<S> ClusterMap<S>
impl<S> ClusterMap<S>
pub fn benchmarking(capacity: usize, hasher: S) -> Self
pub fn insert( &self, locality: Option<Locality>, cluster: BTreeSet<Endpoint> ) -> Option<BTreeSet<Endpoint>>
pub fn apply( &self, locality: Option<Locality>, cluster: EndpointSet ) -> Option<BTreeSet<Endpoint>>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn get( &self, key: &Option<Locality> ) -> Option<Ref<'_, Option<Locality>, EndpointSet, S>>
pub fn get_mut( &self, key: &Option<Locality> ) -> Option<RefMut<'_, Option<Locality>, EndpointSet, S>>
pub fn get_default(&self) -> Option<Ref<'_, Option<Locality>, EndpointSet, S>>
pub fn get_default_mut( &self ) -> Option<RefMut<'_, Option<Locality>, EndpointSet, S>>
pub fn insert_default(&self, endpoints: BTreeSet<Endpoint>)
pub fn remove_endpoint(&self, needle: &Endpoint) -> bool
pub fn remove_endpoint_if(&self, closure: impl Fn(&Endpoint) -> bool) -> bool
pub fn iter(&self) -> Iter<'_, Option<Locality>, EndpointSet, S>
pub fn entry( &self, key: Option<Locality> ) -> Entry<'_, Option<Locality>, EndpointSet, S>
pub fn replace( &self, locality: Option<Locality>, endpoint: Endpoint ) -> Option<Endpoint>
pub fn endpoints(&self) -> Vec<Endpoint>
pub fn nth_endpoint(&self, index: usize) -> Option<Endpoint>
pub fn filter_endpoints(&self, f: impl Fn(&Endpoint) -> bool) -> Vec<Endpoint>
pub fn num_of_endpoints(&self) -> usize
pub fn has_endpoints(&self) -> bool
pub fn update_unlocated_endpoints(&self, locality: Locality)
pub fn remove_locality( &self, locality: &Option<Locality> ) -> Option<EndpointSet>
Trait Implementations§
source§impl Clone for ClusterMap
impl Clone for ClusterMap
source§impl<S> Debug for ClusterMap<S>
impl<S> Debug for ClusterMap<S>
source§impl<S> Default for ClusterMap<S>
impl<S> Default for ClusterMap<S>
source§impl<'de> Deserialize<'de> for ClusterMap
impl<'de> Deserialize<'de> for ClusterMap
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<S> From<ClusterMapDeser> for ClusterMap<S>
impl<S> From<ClusterMapDeser> for ClusterMap<S>
source§fn from(cmd: ClusterMapDeser) -> Self
fn from(cmd: ClusterMapDeser) -> Self
Converts to this type from the input type.
source§impl<S> From<DashMap<Option<Locality>, EndpointSet, S>> for ClusterMap<S>
impl<S> From<DashMap<Option<Locality>, EndpointSet, S>> for ClusterMap<S>
source§impl JsonSchema for ClusterMap
impl JsonSchema for ClusterMap
source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moresource§impl Serialize for ClusterMap
impl Serialize for ClusterMap
Auto Trait Implementations§
impl<S = RandomState> !RefUnwindSafe for ClusterMap<S>
impl<S> Send for ClusterMap<S>where
S: Send,
impl<S> Sync for ClusterMap<S>
impl<S> Unpin for ClusterMap<S>where
S: Unpin,
impl<S> UnwindSafe for ClusterMap<S>where
S: UnwindSafe,
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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 moresource§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