#[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
.
sourcepub fn delta_discovery_request(
&self,
client_state: &ClientState
) -> Result<DeltaDiscoveryRes>
pub fn delta_discovery_request( &self, client_state: &ClientState ) -> 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_delta( &self, type_url: &str, resources: Vec<XdsResource>, removed_resources: &[String], remote_addr: Option<SocketAddr> ) -> 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 Configuration for Config
impl Configuration for Config
fn identifier(&self) -> String
fn allow_request_processing(&self, resource_type: &str) -> bool
fn apply_delta( &self, type_url: &str, resources: Vec<XdsResource>, removed_resources: &[String], remote_addr: Option<SocketAddr> ) -> Result<()>
fn delta_discovery_request( &self, client_state: &ClientState ) -> Result<DeltaDiscoveryRes>
fn interested_resources( &self ) -> impl Iterator<Item = (&'static str, Vec<String>)>
fn on_changed( &self, control_plane: ControlPlane<Self> ) -> impl Future<Output = ()> + Send + 'static
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