#[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(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &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 moreAuto Trait Implementations§
impl Freeze for Config
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
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> 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