File-sink-clear-rotation
Disable runtime rotation on a FileSink. This helper is the direct shortcut for clearing rotation policy on the concrete sink.
Interface
pub fn FileSink::clear_rotation(self : FileSink) -> Unit {input
self : FileSink- File sink whose rotation policy should be cleared.
Explanation
Detailed rules explaining key parameters and behaviors
- This method removes the current rotation policy by setting it to
None. - It changes stored policy only and does not reopen the file.
- Current append and auto-flush settings are left unchanged.
- This helper is equivalent in intent to a broader setter with
None, but is clearer at the call site.
How to Use
Here are some specific examples provided.
When Need To Disable Rotation Explicitly
When direct runtime file rotation should be turned off:
sink.clear_rotation()In this example, rotation policy is removed directly from the sink.
When Need A Clear Intent Shortcut
When code should make the disable-rotation intent obvious:
sink.clear_rotation()
ignore(sink.rotation_enabled())In this example, the call site reads more clearly than using a broader policy setter.
Error Case
e.g.:
If callers need to switch to another rotation config rather than disable rotation,
set_rotation(...)is the better API.This helper does not report past rotation failures; use
rotation_failures()orstate()for diagnostics.
Notes
Use this helper when the desired effect is simply “rotation off”.
It is clearer than passing
Nonethrough a broader setter when intent matters.