datalogic-rs 4.0.21

A fast, type-safe Rust implementation of JSONLogic for evaluating logical rules as JSON. Perfect for business rules engines and dynamic filtering in Rust applications.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
//! Common constants used throughout the codebase

/// Error message for invalid arguments
pub const INVALID_ARGS: &str = "Invalid Arguments";

/// Error message for NaN (Not a Number)
pub const NAN_ERROR: &str = "NaN";

/// Returns a NaN error with a JSON value `{"type": "NaN"}`.
#[inline]
pub fn nan_error() -> crate::Error {
    crate::Error::Thrown(serde_json::json!({"type": "NaN"}))
}