pub struct RotationConfig {
pub max_bytes: u64,
}Expand description
Rotation policy for a DecisionLog.
When the active file’s size exceeds max_bytes, the next append
renames it to a timestamped sibling and opens a fresh file. The
chain id sidecar is preserved per file so a verifier can walk
rotated logs in order. Default behaviour (no rotation) is the
backward-compatible path; supply Some(RotationConfig { .. }) to
open_with_chain / open to enable it.
Fields§
§max_bytes: u64Rotate when the active file exceeds this many bytes.
Implementations§
Source§impl RotationConfig
impl RotationConfig
Sourcepub fn parse(value: &str) -> Result<Self, String>
pub fn parse(value: &str) -> Result<Self, String>
Parse a positive audit-log rotation threshold in bytes.
Sourcepub fn try_from_env() -> Result<Option<Self>, String>
pub fn try_from_env() -> Result<Option<Self>, String>
Read AGENTGUARD_AUDIT_MAX_BYTES from the environment, rejecting
malformed or non-Unicode values instead of silently disabling rotation.
Sourcepub fn from_env() -> Option<Self>
👎Deprecated: use try_from_env to report invalid configuration
pub fn from_env() -> Option<Self>
Lossy legacy environment parser. Prefer Self::try_from_env.
Trait Implementations§
Source§impl Clone for RotationConfig
impl Clone for RotationConfig
Source§fn clone(&self) -> RotationConfig
fn clone(&self) -> RotationConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RotationConfig
impl RefUnwindSafe for RotationConfig
impl Send for RotationConfig
impl Sync for RotationConfig
impl Unpin for RotationConfig
impl UnwindSafe for RotationConfig
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
Converts
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>
Converts
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