pub struct ReceiptsConfig {
pub max_file_bytes: Option<u64>,
pub retained_files: Option<u32>,
}Expand description
Download-receipt audit-log retention section of the config file (#802).
Bounds the otherwise-unbounded download_receipts.jsonl (one line per
accepted payment proof, ~1 per MiB delivered) with size-based rotation:
once the live file reaches max_file_bytes it is rotated to a numbered
backup (download_receipts.jsonl.1, .2, …) and a fresh file is opened;
the oldest backup beyond retained_files is deleted. Both fields are
optional; the defaults bound disk to roughly (retained_files + 1) * max_file_bytes while keeping a useful audit window.
Fields§
§max_file_bytes: Option<u64>Rotate the live receipt log once it reaches this many bytes. Absent => default 128 MiB. Validated against a floor (1 MiB) and ceiling (1 GiB) so a typo cannot rotate every line or defeat rotation entirely.
retained_files: Option<u32>Number of rotated backup files to retain (.1..=.N). Absent =>
default 4. 0 keeps no backups (the live file is truncated in place on
rotation). Capped at 100.
Trait Implementations§
Source§impl Debug for ReceiptsConfig
impl Debug for ReceiptsConfig
Source§impl Default for ReceiptsConfig
impl Default for ReceiptsConfig
Source§impl<'de> Deserialize<'de> for ReceiptsConfig
impl<'de> Deserialize<'de> for ReceiptsConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for ReceiptsConfig
impl RefUnwindSafe for ReceiptsConfig
impl Send for ReceiptsConfig
impl Sync for ReceiptsConfig
impl Unpin for ReceiptsConfig
impl UnsafeUnpin for ReceiptsConfig
impl UnwindSafe for ReceiptsConfig
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
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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 more