Runtime-sink-file-auto-flush
Read whether auto-flush is currently enabled on a file-backed RuntimeSink. This helper exposes one important direct runtime durability policy flag without going through ConfiguredLogger.
Interface
pub fn RuntimeSink::file_auto_flush(self : RuntimeSink) -> Bool {input
self : RuntimeSink- Runtime sink whose file auto-flush policy should be inspected.
output
Bool- Whether auto-flush is currently enabled.
Explanation
Detailed rules explaining key parameters and behaviors
- Plain
Fileruntime variants report the current auto-flush policy from the wrappedFileSink. QueuedFileruntime variants forward the policy from the wrapped innerFileSink.- Non-file runtime variants return
false. - This helper exposes policy state only and does not force any flush action.
How to Use
Here are some specific examples provided.
When Need Direct Runtime Durability Visibility
When code owns a RuntimeSink directly and should expose whether each file write auto-flushes:
let enabled = sink.file_auto_flush()In this example, runtime file durability policy is surfaced without going through a logger wrapper.
When Validate Direct Policy Updates
When code should observe auto-flush after a direct runtime setter call:
ignore(sink.file_set_auto_flush(true))
ignore(sink.file_auto_flush())In this example, callers verify the updated policy on the runtime sink itself.
Error Case
e.g.:
If the runtime sink is not file-backed, the method returns
false.If callers need to actually flush file output,
file_flush()is the operational API.
Notes
Use this helper to inspect direct runtime durability policy on
RuntimeSinkvalues.It complements
file_set_auto_flush(...)rather than replacing real flush actions.