pub struct ConfigDb;Expand description
The configuration database. All methods are associated functions over an ambient per-test store (D11, D16).
Implementations§
Source§impl ConfigDb
impl ConfigDb
Sourcepub fn set<T: Clone + Debug + 'static>(
ctx: Option<&RustdvCtx>,
offset: &str,
field: &str,
value: T,
)
pub fn set<T: Clone + Debug + 'static>( ctx: Option<&RustdvCtx>, offset: &str, field: &str, value: T, )
Store value for every component whose path matches offset
(a glob), resolved against ctx.
Sourcepub fn get<T: Clone + 'static>(
ctx: Option<&RustdvCtx>,
offset: &str,
field: &str,
) -> Result<T, ConfigError>
pub fn get<T: Clone + 'static>( ctx: Option<&RustdvCtx>, offset: &str, field: &str, ) -> Result<T, ConfigError>
Read field for the component at ctx + offset.
The offset must be concrete — globs are legal only when storing (D12, pyuvm’s rule). Resolution is most-specific path first, then highest precedence, then most recent write (D13).
Sourcepub fn exists(ctx: Option<&RustdvCtx>, offset: &str, field: &str) -> bool
pub fn exists(ctx: Option<&RustdvCtx>, offset: &str, field: &str) -> bool
Is there a value for this field, without producing an error?
Sourcepub fn set_tracing(on: bool)
pub fn set_tracing(on: bool)
Log every set and get as it happens: the context, the offset, and
the path they resolved to — which is what you actually got wrong when
a lookup misses. Port of pyuvm’s ConfigDB().is_tracing.
pub fn is_tracing() -> bool
Sourcepub fn print()
pub fn print()
Print the whole database, including precedences. A resolved value tells you who won; this tells you who else was competing, which is what a parent/child conflict needs (D68).
Sourcepub fn dump() -> String
pub fn dump() -> String
The dump as a string, for tests and for callers that want to route it somewhere other than the log.