Runtime-sink-file-policy-matches-default
Read whether the current runtime file policy still matches the default policy of a RuntimeSink. This helper is useful for detecting operational drift on direct sink values.
Interface
pub fn RuntimeSink::file_policy_matches_default(self : RuntimeSink) -> Bool {input
self : RuntimeSink- Runtime sink whose runtime policy drift should be checked.
output
Bool- Whether the current runtime file policy still matches the default.
Explanation
Detailed rules explaining key parameters and behaviors
- Plain
Fileruntime variants compare current runtime file policy against their stored defaults. QueuedFileruntime variants forward the comparison from the wrapped innerFileSink.- Non-file runtime variants return
false. - This helper is a compact drift signal when callers do not need to compare full policy objects directly.
How to Use
Here are some specific examples provided.
When Need Drift Detection
When diagnostics should report whether file policy changed after startup:
let unchanged = sink.file_policy_matches_default()In this example, the runtime sink exposes whether runtime file policy still matches the baseline.
When Gate Reset Logic
When code should only reset policy if drift exists:
if !sink.file_policy_matches_default() {
ignore(sink.file_reset_policy())
}In this example, policy reset only happens when runtime state diverged from defaults.
Error Case
e.g.:
If the runtime sink is not file-backed, the method returns
false.If callers need the exact differences instead of a boolean drift signal, they should inspect both
file_policy()andfile_default_policy().
Notes
Use this helper for compact runtime policy drift checks.
It is especially useful before calling reset-style operations.