pub enum EvaluationError {
BufferOverrun {
offset: usize,
},
InvalidOffset {
offset: i64,
},
UnsupportedType {
type_name: String,
},
RecursionLimitExceeded {
depth: u32,
},
StringLengthExceeded {
length: usize,
max_length: usize,
},
InvalidStringEncoding {
offset: usize,
},
Timeout {
timeout_ms: u64,
},
TypeReadError(TypeReadError),
InternalError {
message: String,
},
}Expand description
Errors that can occur during rule evaluation.
Variants§
BufferOverrun
Buffer overrun during file reading.
InvalidOffset
Invalid offset calculation.
UnsupportedType
Unsupported type during evaluation.
RecursionLimitExceeded
Recursion limit exceeded during evaluation.
StringLengthExceeded
String length limit exceeded.
InvalidStringEncoding
Invalid string encoding.
Timeout
Evaluation timeout exceeded.
TypeReadError(TypeReadError)
Type reading error during evaluation.
InternalError
Internal error indicating a bug in the evaluation logic.
Implementations§
Source§impl EvaluationError
impl EvaluationError
Sourcepub fn buffer_overrun(offset: usize) -> Self
pub fn buffer_overrun(offset: usize) -> Self
Create a new BufferOverrun error.
Sourcepub fn invalid_offset(offset: i64) -> Self
pub fn invalid_offset(offset: i64) -> Self
Create a new InvalidOffset error.
Sourcepub fn unsupported_type(type_name: impl Into<String>) -> Self
pub fn unsupported_type(type_name: impl Into<String>) -> Self
Create a new UnsupportedType error.
Sourcepub fn recursion_limit_exceeded(depth: u32) -> Self
pub fn recursion_limit_exceeded(depth: u32) -> Self
Create a new RecursionLimitExceeded error.
Sourcepub fn string_length_exceeded(length: usize, max_length: usize) -> Self
pub fn string_length_exceeded(length: usize, max_length: usize) -> Self
Create a new StringLengthExceeded error.
Sourcepub fn invalid_string_encoding(offset: usize) -> Self
pub fn invalid_string_encoding(offset: usize) -> Self
Create a new InvalidStringEncoding error.
Sourcepub fn internal_error(message: impl Into<String>) -> Self
pub fn internal_error(message: impl Into<String>) -> Self
Create a new InternalError error.
Trait Implementations§
Source§impl Debug for EvaluationError
impl Debug for EvaluationError
Source§impl Display for EvaluationError
impl Display for EvaluationError
Source§impl Error for EvaluationError
impl Error for EvaluationError
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<EvaluationError> for LibmagicError
impl From<EvaluationError> for LibmagicError
Source§fn from(source: EvaluationError) -> Self
fn from(source: EvaluationError) -> Self
Converts to this type from the input type.
Source§impl From<TypeReadError> for EvaluationError
impl From<TypeReadError> for EvaluationError
Source§fn from(source: TypeReadError) -> Self
fn from(source: TypeReadError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for EvaluationError
impl RefUnwindSafe for EvaluationError
impl Send for EvaluationError
impl Sync for EvaluationError
impl Unpin for EvaluationError
impl UnsafeUnpin for EvaluationError
impl UnwindSafe for EvaluationError
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