pub enum SanitizeError {
ValueTooLarge {
size: usize,
limit: usize,
},
TooManyArgs {
count: usize,
limit: usize,
},
TooDeep {
depth: usize,
limit: usize,
},
DisallowedKind(ValueKind),
KeyTooLong {
size: usize,
limit: usize,
},
}Expand description
Error returned when a value violates a hard sanitizer limit.
“Soft” actions (stripping control characters, redacting secrets, truncating
when configured to do so) do not error — they are recorded in the
SanitizeReport. Errors are reserved for policy violations the caller
asked to be treated as fatal.
Variants§
ValueTooLarge
A string or blob exceeded max_string_bytes and truncation was
disabled.
TooManyArgs
The total number of positional + keyword arguments exceeded
max_arg_count.
TooDeep
Container nesting exceeded max_depth.
DisallowedKind(ValueKind)
A value of a disallowed kind was encountered.
KeyTooLong
A key was longer than max_key_bytes.
Trait Implementations§
Source§impl Clone for SanitizeError
impl Clone for SanitizeError
Source§impl Debug for SanitizeError
impl Debug for SanitizeError
Source§impl Display for SanitizeError
impl Display for SanitizeError
impl Eq for SanitizeError
Source§impl Error for SanitizeError
impl Error for SanitizeError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<SanitizeError> for CelersError
impl From<SanitizeError> for CelersError
Source§fn from(err: SanitizeError) -> Self
fn from(err: SanitizeError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for SanitizeError
impl PartialEq for SanitizeError
impl StructuralPartialEq for SanitizeError
Auto Trait Implementations§
impl Freeze for SanitizeError
impl RefUnwindSafe for SanitizeError
impl Send for SanitizeError
impl Sync for SanitizeError
impl Unpin for SanitizeError
impl UnsafeUnpin for SanitizeError
impl UnwindSafe for SanitizeError
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