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>

source

pub fn new() -> Self

source

pub fn new_default(cluster: BTreeSet<Endpoint>) -> Self

source§

impl<S> ClusterMap<S>

source

pub fn version(&self) -> u64

source§

impl<S> ClusterMap<S>
where S: Default + BuildHasher + Clone,

source

pub fn benchmarking(capacity: usize, hasher: S) -> Self

source

pub fn insert( &self, locality: Option<Locality>, cluster: BTreeSet<Endpoint> ) -> Option<BTreeSet<Endpoint>>

source

pub fn apply( &self, locality: Option<Locality>, cluster: EndpointSet ) -> Option<BTreeSet<Endpoint>>

source

pub fn len(&self) -> usize

source

pub fn is_empty(&self) -> bool

source

pub fn get( &self, key: &Option<Locality> ) -> Option<Ref<'_, Option<Locality>, EndpointSet, S>>

source

pub fn get_mut( &self, key: &Option<Locality> ) -> Option<RefMut<'_, Option<Locality>, EndpointSet, S>>

source

pub fn get_default(&self) -> Option<Ref<'_, Option<Locality>, EndpointSet, S>>

source

pub fn get_default_mut( &self ) -> Option<RefMut<'_, Option<Locality>, EndpointSet, S>>

source

pub fn insert_default(&self, endpoints: BTreeSet<Endpoint>)

source

pub fn remove_endpoint(&self, needle: &Endpoint) -> bool

source

pub fn remove_endpoint_if(&self, closure: impl Fn(&Endpoint) -> bool) -> bool

source

pub fn iter(&self) -> Iter<'_, Option<Locality>, EndpointSet, S>

source

pub fn entry( &self, key: Option<Locality> ) -> Entry<'_, Option<Locality>, EndpointSet, S>

source

pub fn replace( &self, locality: Option<Locality>, endpoint: Endpoint ) -> Option<Endpoint>

source

pub fn endpoints(&self) -> Vec<Endpoint>

source

pub fn nth_endpoint(&self, index: usize) -> Option<Endpoint>

source

pub fn filter_endpoints(&self, f: impl Fn(&Endpoint) -> bool) -> Vec<Endpoint>

source

pub fn num_of_endpoints(&self) -> usize

source

pub fn has_endpoints(&self) -> bool

source

pub fn update_unlocated_endpoints(&self, locality: Locality)

source

pub fn remove_locality( &self, locality: &Option<Locality> ) -> Option<EndpointSet>

Trait Implementations§

source§

impl Clone for ClusterMap

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<S> Debug for ClusterMap<S>
where S: Default + BuildHasher + Clone,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<S> Default for ClusterMap<S>
where S: Default + BuildHasher + Clone,

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for ClusterMap

source§

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>
where S: Default + BuildHasher + Clone,

source§

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>
where S: Default + BuildHasher + Clone,

source§

fn from(map: DashMap<Option<Locality>, EndpointSet, S>) -> Self

Converts to this type from the input type.
source§

impl JsonSchema for ClusterMap

source§

fn schema_name() -> String

The name of the generated JSON Schema. Read more
source§

fn json_schema(gen: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
source§

fn is_referenceable() -> bool

Whether JSON Schemas generated for this type should be re-used where possible using the $ref keyword. Read more
§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
source§

impl Serialize for ClusterMap

source§

fn serialize<S>(&self, ser: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<S> Watchable for ClusterMap<S>

source§

fn mark(&self) -> Marker

source§

fn has_changed(&self, marker: Marker) -> bool

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>
where S: Sync + Send,

§

impl<S> Unpin for ClusterMap<S>
where S: Unpin,

§

impl<S> UnwindSafe for ClusterMap<S>
where S: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> DynClone for T
where T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,