#[non_exhaustive]pub struct Config {
pub clusters: Watch<ClusterMap>,
pub filters: Slot<FilterChain>,
pub id: Slot<String>,
pub version: Slot<Version>,
pub datacenter: DatacenterConfig,
}
Expand description
Configuration for a component
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.clusters: Watch<ClusterMap>
§filters: Slot<FilterChain>
§id: Slot<String>
§version: Slot<Version>
§datacenter: DatacenterConfig
Implementations§
source§impl Config
impl Config
sourcepub fn from_reader<R: Read>(input: R) -> Result<Self, Error>
pub fn from_reader<R: Read>(input: R) -> Result<Self, Error>
Attempts to deserialize input
as a YAML object representing Self
.
pub fn discovery_request( &self, _node_id: &str, resource_type: ResourceType, names: &[String] ) -> Result<Vec<Any>, Error>
sourcepub fn delta_discovery_request(
&self,
subscribed: &BTreeSet<String>,
client_versions: &ClientVersions
) -> Result<DeltaDiscoveryRes>
pub fn delta_discovery_request( &self, subscribed: &BTreeSet<String>, client_versions: &ClientVersions ) -> Result<DeltaDiscoveryRes>
Given a list of subscriptions and the current state of the calling client, construct a response with the current state of our resources that differ from those of the client
pub fn apply(&self, response: Resource) -> Result<()>
pub fn apply_delta( &self, resource_type: ResourceType, resources: impl Iterator<Item = Result<(Resource, String)>>, removed_resources: Vec<String>, local_versions: &mut HashMap<String, String> ) -> Result<()>
pub fn apply_metrics(&self)
pub fn default_agent() -> Self
pub fn default_non_agent() -> Self
sourcepub fn datacenters(&self) -> &Watch<DatacenterMap>
pub fn datacenters(&self) -> &Watch<DatacenterMap>
Gets the datacenters, panicking if this is an agent config
Trait Implementations§
source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
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 JsonSchema for Config
impl JsonSchema for Config
source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. 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
§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 moreAuto Trait Implementations§
impl !RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl !UnwindSafe for Config
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