pub enum HyperscanErrorCode {
Show 14 variants
Invalid,
Nomem,
ScanTerminated,
CompilerError,
DbVersionError,
DbPlatformError,
DbModeError,
BadAlign,
BadAlloc,
ScratchInUse,
ArchError,
InsufficientSpace,
UnknownError,
UnknownErrorCode,
}
Variants§
Invalid
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
A memory allocation failed.
ScanTerminated
The engine was terminated by callback.
This return value indicates that the target buffer was partially scanned, but that the callback function requested that scanning cease after a match was located.
CompilerError
The pattern compiler failed, and the hs_compile_error_t should be inspected for more detail.
DbVersionError
The given database was built for a different version of Hyperscan.
DbPlatformError
The given database was built for a different platform (i.e., CPU type).
DbModeError
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
A parameter passed to this function was not correctly aligned.
BadAlloc
The memory allocator (either malloc() or the allocator set with hs_set_allocator()) did not correctly return memory suitably aligned for the largest representable data type on this platform.
ScratchInUse
The scratch region was already in use.
s error is returned when Hyperscan is able to detect that the scratch region given is already in use by another Hyperscan API call.
A separate scratch region, allocated with hs_alloc_scratch() or hs_clone_scratch(), is required for every concurrent caller of the Hyperscan API.
For example, this error might be returned when hs_scan() has been called inside a callback delivered by a currently-executing hs_scan() 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.
ArchError
Unsupported CPU architecture.
This error is returned when Hyperscan is able to detect that the current system does not support the required instruction set.
At a minimum, Hyperscan requires Supplemental Streaming SIMD Extensions 3 (SSSE3).
InsufficientSpace
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.
UnknownError
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.