pub struct SafetyLimits {
pub max_line_size: usize,
pub max_text_block_size: usize,
pub max_buffer_size: usize,
pub max_log_preview_chars: usize,
pub max_buffered_messages: usize,
pub json_parse_timeout_ms: u64,
}Expand description
Safety limits for text processing
Fields§
§max_line_size: usizeMaximum size for a single line from CLI output (bytes)
max_text_block_size: usizeMaximum size for a single text content block (bytes)
max_buffer_size: usizeMaximum total memory usage for buffered messages (bytes)
max_log_preview_chars: usizeMaximum length for log previews (characters)
max_buffered_messages: usizeMaximum number of messages to buffer before applying backpressure
json_parse_timeout_ms: u64Timeout for JSON parsing operations (milliseconds)
Implementations§
Source§impl SafetyLimits
impl SafetyLimits
Sourcepub fn conservative() -> Self
pub fn conservative() -> Self
Create conservative limits for memory-constrained environments
Sourcepub fn is_line_size_safe(&self, size: usize) -> bool
pub fn is_line_size_safe(&self, size: usize) -> bool
Check if a line size is within limits
Sourcepub fn is_text_block_safe(&self, size: usize) -> bool
pub fn is_text_block_safe(&self, size: usize) -> bool
Check if a text block size is within limits
Sourcepub fn safe_log_preview(&self, text: &str) -> String
pub fn safe_log_preview(&self, text: &str) -> String
Get safe log preview for a string
Trait Implementations§
Source§impl Clone for SafetyLimits
impl Clone for SafetyLimits
Source§fn clone(&self) -> SafetyLimits
fn clone(&self) -> SafetyLimits
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 moreSource§impl Debug for SafetyLimits
impl Debug for SafetyLimits
Auto Trait Implementations§
impl Freeze for SafetyLimits
impl RefUnwindSafe for SafetyLimits
impl Send for SafetyLimits
impl Sync for SafetyLimits
impl Unpin for SafetyLimits
impl UnwindSafe for SafetyLimits
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,
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>
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