pub struct ConfigAttr {
pub env_name: Option<String>,
pub py_name: Option<String>,
pub propagate: bool,
}Expand description
Metadata describing how a configuration key is exposed across environments.
Each ConfigAttr entry defines how a Rust configuration key maps
to external representations:
env_name: the environment variable consulted byglobal::init_from_env()when loading configuration.py_name: the Python keyword argument accepted bymonarch.configure(...)and returned byget_configuration().propagate: whether this config should be inherited by child processes spawned viaBootstrapProcManager. Set tofalsefor process-local configs (e.g., TLS cert paths).
All configuration keys should carry this meta-attribute via
@meta(CONFIG = ConfigAttr { ... }).
Fields§
§env_name: Option<String>Environment variable consulted by global::init_from_env().
py_name: Option<String>Python kwarg name used by monarch.configure(...) and
get_configuration().
propagate: boolWhether this config should be inherited by child processes.
Set to false for process-local configs like TLS cert paths.
Implementations§
Source§impl ConfigAttr
impl ConfigAttr
Sourcepub fn new(env_name: Option<String>, py_name: Option<String>) -> Self
pub fn new(env_name: Option<String>, py_name: Option<String>) -> Self
Create a new ConfigAttr with the given env/py names.
Defaults to propagate: true (inherited by child processes).
Use process_local for configs that
should not propagate.
Sourcepub fn process_local(self) -> Self
pub fn process_local(self) -> Self
Mark this config as process-local (not propagated to children).
Use for configs like TLS cert paths that are specific to the current process.
Trait Implementations§
Source§impl AttrValue for ConfigAttr
impl AttrValue for ConfigAttr
Source§impl Clone for ConfigAttr
impl Clone for ConfigAttr
Source§fn clone(&self) -> ConfigAttr
fn clone(&self) -> ConfigAttr
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ConfigAttr
impl Debug for ConfigAttr
Source§impl<'de> Deserialize<'de> for ConfigAttr
impl<'de> Deserialize<'de> for ConfigAttr
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 Named for ConfigAttr
impl Named for ConfigAttr
Source§fn typename() -> &'static str
fn typename() -> &'static str
§fn typeid() -> TypeId
fn typeid() -> TypeId
§fn port() -> u64
fn port() -> u64
Auto Trait Implementations§
impl Freeze for ConfigAttr
impl RefUnwindSafe for ConfigAttr
impl Send for ConfigAttr
impl Sync for ConfigAttr
impl Unpin for ConfigAttr
impl UnwindSafe for ConfigAttr
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,
§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> 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>
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>
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