pub enum SecurityError {
PathTraversal,
AbsolutePath,
NullByte,
TooLong,
ReservedName(String),
InvalidUtf8,
FileTooLarge {
size_bytes: usize,
max_bytes: usize,
},
OverflowError,
OutOfBounds {
index: usize,
total: usize,
},
}Expand description
Errors produced by OxiHuman security validation functions.
Variants§
PathTraversal
Path contains a .. component that could escape the intended root.
AbsolutePath
Path is absolute (starts with /, \, or a Windows drive letter like C:\).
NullByte
Path contains a null byte (\0).
TooLong
Path exceeds the maximum allowed length (512 characters).
ReservedName(String)
Path component matches a Windows reserved device name (e.g. CON, NUL).
InvalidUtf8
Path bytes are not valid UTF-8.
FileTooLarge
File size exceeds the configured maximum.
OverflowError
An arithmetic overflow occurred during stride/offset computation.
OutOfBounds
A computed index is out of bounds for the given buffer.
Trait Implementations§
Source§impl Clone for SecurityError
impl Clone for SecurityError
Source§fn clone(&self) -> SecurityError
fn clone(&self) -> SecurityError
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 SecurityError
impl Debug for SecurityError
Source§impl Display for SecurityError
impl Display for SecurityError
Source§impl Error for SecurityError
impl Error for SecurityError
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 PartialEq for SecurityError
impl PartialEq for SecurityError
impl Eq for SecurityError
impl StructuralPartialEq for SecurityError
Auto Trait Implementations§
impl Freeze for SecurityError
impl RefUnwindSafe for SecurityError
impl Send for SecurityError
impl Sync for SecurityError
impl Unpin for SecurityError
impl UnsafeUnpin for SecurityError
impl UnwindSafe for SecurityError
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