Struct mz_dyncfg::ConfigUpdates
source · pub struct ConfigUpdates {
pub updates: BTreeMap<String, ProtoConfigVal>,
}
Expand description
A batch of value updates to [Config]s in a [ConfigSet].
This may be sent across processes to apply the same value updates, but may not be durably written down.
Intentionally not named with the usual Proto prefix because we pass this around directly.
Fields§
§updates: BTreeMap<String, ProtoConfigVal>
Implementations§
source§impl ConfigUpdates
impl ConfigUpdates
sourcepub fn add<T, U>(&mut self, config: &Config<T>, val: U)
pub fn add<T, U>(&mut self, config: &Config<T>, val: U)
Adds an update for the given config and value.
If a value of the same config has previously been added to these updates, replaces it.
sourcepub fn add_dynamic(&mut self, name: &str, val: ConfigVal)
pub fn add_dynamic(&mut self, name: &str, val: ConfigVal)
Adds an update for the given configuration name and value.
It is the callers responsibility to ensure the value is of the appropriate type for the configuration.
If a value of the same config has previously been added to these updates, replaces it.
sourcepub fn extend(&mut self, other: Self)
pub fn extend(&mut self, other: Self)
Adds the entries in other
to self
, with other
taking precedence.
sourcepub fn apply(&self, set: &ConfigSet)
pub fn apply(&self, set: &ConfigSet)
Applies these config updates to the given ConfigSet.
This doesn’t need to be the same set that the value updates were added from. In fact, the primary use of this is propagating config updates across processes.
The value updates for any configs unknown by the given set are skipped. Ditto for config type mismatches. However, this is unexpected usage at present and so is logged to Sentry.
Trait Implementations§
source§impl Arbitrary for ConfigUpdates
impl Arbitrary for ConfigUpdates
§type Parameters = <BTreeMap<String, ProtoConfigVal> as Arbitrary>::Parameters
type Parameters = <BTreeMap<String, ProtoConfigVal> as Arbitrary>::Parameters
arbitrary_with
accepts for configuration
of the generated Strategy
. Parameters must implement Default
.§type Strategy = Map<<BTreeMap<String, ProtoConfigVal> as Arbitrary>::Strategy, fn(_: BTreeMap<String, ProtoConfigVal>) -> ConfigUpdates>
type Strategy = Map<<BTreeMap<String, ProtoConfigVal> as Arbitrary>::Strategy, fn(_: BTreeMap<String, ProtoConfigVal>) -> ConfigUpdates>
Strategy
used to generate values of type Self
.source§fn arbitrary_with(_top: Self::Parameters) -> Self::Strategy
fn arbitrary_with(_top: Self::Parameters) -> Self::Strategy
source§impl Clone for ConfigUpdates
impl Clone for ConfigUpdates
source§fn clone(&self) -> ConfigUpdates
fn clone(&self) -> ConfigUpdates
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ConfigUpdates
impl Debug for ConfigUpdates
source§impl Default for ConfigUpdates
impl Default for ConfigUpdates
source§impl<'de> Deserialize<'de> for ConfigUpdates
impl<'de> Deserialize<'de> for ConfigUpdates
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>,
source§impl Message for ConfigUpdates
impl Message for ConfigUpdates
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moresource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.source§impl PartialEq for ConfigUpdates
impl PartialEq for ConfigUpdates
source§impl Serialize for ConfigUpdates
impl Serialize for ConfigUpdates
impl StructuralPartialEq for ConfigUpdates
Auto Trait Implementations§
impl Freeze for ConfigUpdates
impl RefUnwindSafe for ConfigUpdates
impl Send for ConfigUpdates
impl Sync for ConfigUpdates
impl Unpin for ConfigUpdates
impl UnwindSafe for ConfigUpdates
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request
source§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<P, R> ProtoType<R> for Pwhere
R: RustType<P>,
impl<P, R> ProtoType<R> for Pwhere
R: RustType<P>,
source§fn into_rust(self) -> Result<R, TryFromProtoError>
fn into_rust(self) -> Result<R, TryFromProtoError>
RustType::from_proto
.source§fn from_rust(rust: &R) -> P
fn from_rust(rust: &R) -> P
RustType::into_proto
.