pub struct RotationPolicy { /* private fields */ }Expand description
Size-based rotation policy for JsonlReceiptLog (issue #802).
max_file_bytes is the size at which the live file is rotated;
retained_files is how many numbered backups (.1..=.N) to keep (0
truncates the live file in place instead of keeping backups). A
max_file_bytes of 0 disables rotation entirely (the live file grows
unbounded) — a degenerate value the engine accepts but production never
produces.
The engine deliberately accepts any values (the rotation guards in
JsonlReceiptLog::append cope with a sub-line cap, and tests use tiny
caps to exercise rotation deterministically). Production policies are built
only from a decdn_common::config::ResolvedReceipts via the From
impl below, and that config type is range-validated by
decdn_common::config::resolve_config — so every live policy is within the
operator-facing safe bounds ([MIN_RECEIPT_MAX_FILE_BYTES, MAX_RECEIPT_MAX_FILE_BYTES], retained_files <= MAX_RECEIPT_RETAINED_FILES).
Trait Implementations§
Source§impl Clone for RotationPolicy
impl Clone for RotationPolicy
impl Copy for RotationPolicy
Source§impl Debug for RotationPolicy
impl Debug for RotationPolicy
Source§impl From<&ResolvedReceipts> for RotationPolicy
impl From<&ResolvedReceipts> for RotationPolicy
Source§fn from(r: &ResolvedReceipts) -> Self
fn from(r: &ResolvedReceipts) -> Self
The sole production constructor. ResolvedReceipts is range-validated by
the config resolver, so the policy is always within the operator-facing
safe bounds — the validation guarantee carries across the type boundary
instead of being re-opened by a raw constructor.
Auto Trait Implementations§
impl Freeze for RotationPolicy
impl RefUnwindSafe for RotationPolicy
impl Send for RotationPolicy
impl Sync for RotationPolicy
impl Unpin for RotationPolicy
impl UnsafeUnpin for RotationPolicy
impl UnwindSafe for RotationPolicy
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,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request