#[repr(i8)]pub enum VectorscanRuntimeError {
Show 13 variants
Invalid = -1,
NoMem = -2,
ScanTerminated = -3,
CompilerError = -4,
DbVersionError = -5,
DbPlatformError = -6,
DbModeError = -7,
BadAlign = -8,
BadAlloc = -9,
ScratchInUse = -10,
ArchError = -11,
InsufficientSpace = -12,
UnknownError = -13,
}
Expand description
Native error code from the underlying vectorscan library.
Variants§
Invalid = -1
A parameter passed to this function was invalid.
This error is only returned in cases where the function can detect an invalid parameter – it cannot be relied upon to detect (for example) pointers to freed memory or other invalid data.
NoMem = -2
A memory allocation failed.
ScanTerminated = -3
The engine was terminated by callback.
This return value indicates that the target buffer was partially scanned,
but that the callback function returned
MatchResult::CeaseMatching
after a match was located.
CompilerError = -4
The pattern compiler failed, and the CompileError
should be
inspected for more detail.
DbVersionError = -5
The given database was built for a different version of Vectorscan.
DbPlatformError = -6
The given database was built for a different platform (i.e., CPU type).
DbModeError = -7
The given database was built for a different mode of operation.
This error is returned when streaming calls are used with a block or vectored database and vice versa.
BadAlign = -8
A parameter passed to this function was not correctly aligned.
BadAlloc = -9
The memory allocator returned incorrectly aligned memory.
The memory allocator (either libc::malloc()
or the allocator set with
crate::alloc::set_allocator()
) did not
correctly return memory suitably aligned for the largest representable
data type on this platform.
ScratchInUse = -10
The scratch region was already in use.
This error is returned when Vectorscan is able to detect that the scratch region given is already in use by another Vectorscan API call.
A separate scratch region, allocated with
Scratch::setup_for_db()
or
Scratch::try_clone()
, is required
for every concurrent caller of the Vectorscan API.
For example, this error might be returned when
scan_sync()
has been
called inside a callback delivered by a currently-executing
scan_sync()
call using the same
scratch region.
Note: Not all concurrent uses of scratch regions may be detected. This error is intended as a best-effort debugging tool, not a guarantee.
Note: safe Rust code should never see this error. See crate::state
for
ways to manage scratch spaces.
ArchError = -11
Unsupported CPU architecture.
This error is returned when Vectorscan is able to detect that the current system does not support the required instruction set.
At a minimum, Vectorscan requires Supplemental Streaming SIMD Extensions 3 (SSSE3).
InsufficientSpace = -12
Provided buffer was too small.
This error indicates that there was insufficient space in the buffer. The call should be repeated with a larger provided buffer.
Note: in this situation, it is normal for the amount of space required to be returned in the same manner as the used space would have been returned if the call was successful.
This value is referenced internally in
LiveStream::compress()
when requesting the
amount of memory to allocate for a compressed stream. Users of this
library should never see this error when using the
CompressReserveBehavior
interface.
UnknownError = -13
Unexpected internal error.
This error indicates that there was unexpected matching behaviors. This could be related to invalid usage of stream and scratch space or invalid memory operations by users.
Trait Implementations§
Source§impl Clone for VectorscanRuntimeError
impl Clone for VectorscanRuntimeError
Source§fn clone(&self) -> VectorscanRuntimeError
fn clone(&self) -> VectorscanRuntimeError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for VectorscanRuntimeError
impl Debug for VectorscanRuntimeError
Source§impl Display for VectorscanRuntimeError
impl Display for VectorscanRuntimeError
Source§impl Error for VectorscanRuntimeError
impl Error for VectorscanRuntimeError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl From<VectorscanRuntimeError> for ChimeraError
Available on crate feature chimera
only.
impl From<VectorscanRuntimeError> for ChimeraError
chimera
only.Source§fn from(source: VectorscanRuntimeError) -> Self
fn from(source: VectorscanRuntimeError) -> Self
Source§impl From<VectorscanRuntimeError> for CompressionError
impl From<VectorscanRuntimeError> for CompressionError
Source§fn from(source: VectorscanRuntimeError) -> Self
fn from(source: VectorscanRuntimeError) -> Self
Source§impl From<VectorscanRuntimeError> for ScanError
impl From<VectorscanRuntimeError> for ScanError
Source§fn from(source: VectorscanRuntimeError) -> Self
fn from(source: VectorscanRuntimeError) -> Self
Source§impl From<VectorscanRuntimeError> for VectorscanCompileError
impl From<VectorscanRuntimeError> for VectorscanCompileError
Source§fn from(source: VectorscanRuntimeError) -> Self
fn from(source: VectorscanRuntimeError) -> Self
Source§impl From<VectorscanRuntimeError> for VectorscanError
impl From<VectorscanRuntimeError> for VectorscanError
Source§fn from(source: VectorscanRuntimeError) -> Self
fn from(source: VectorscanRuntimeError) -> Self
Source§impl From<VectorscanRuntimeError> for i8
impl From<VectorscanRuntimeError> for i8
Source§fn from(enum_value: VectorscanRuntimeError) -> Self
fn from(enum_value: VectorscanRuntimeError) -> Self
Source§impl From<i8> for VectorscanRuntimeError
impl From<i8> for VectorscanRuntimeError
Source§impl Hash for VectorscanRuntimeError
impl Hash for VectorscanRuntimeError
Source§impl Ord for VectorscanRuntimeError
impl Ord for VectorscanRuntimeError
Source§fn cmp(&self, other: &VectorscanRuntimeError) -> Ordering
fn cmp(&self, other: &VectorscanRuntimeError) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for VectorscanRuntimeError
impl PartialEq for VectorscanRuntimeError
Source§impl PartialOrd for VectorscanRuntimeError
impl PartialOrd for VectorscanRuntimeError
impl Copy for VectorscanRuntimeError
impl Eq for VectorscanRuntimeError
impl StructuralPartialEq for VectorscanRuntimeError
Auto Trait Implementations§
impl Freeze for VectorscanRuntimeError
impl RefUnwindSafe for VectorscanRuntimeError
impl Send for VectorscanRuntimeError
impl Sync for VectorscanRuntimeError
impl Unpin for VectorscanRuntimeError
impl UnwindSafe for VectorscanRuntimeError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.