3 releases

0.0.3 Sep 29, 2024
0.0.2 Sep 16, 2024
0.0.1 Sep 16, 2024

#1277 in Rust patterns

Download history 167/week @ 2024-09-24 22/week @ 2024-10-01 8/week @ 2024-10-08 2/week @ 2024-10-15 4/week @ 2024-10-29 9/week @ 2024-11-05 3/week @ 2024-12-10

161 downloads per month

MIT license

15KB
350 lines

Dare

A flexible Value enum implementation in Rust, supporting various data types and providing type-safe operations.

Features

  • Supports multiple data types: null, boolean, float, integer, string, array.
  • Easy conversion with From trait implementations
  • Type-checking and accessor methods

Usage

use dare::Value;

let number = Value::from(42);
let string = Value::from("Hello");
let array = Value::from(vec![Value::from(1), Value::from(2)]);

assert!(number.is_number());
assert_eq!(string.as_string(), Some("Hello".to_string()));

println!("{}", array); // Outputs: [1, 2]

Dependencies

~160KB