| Crates.io | zodiac-sign |
| lib.rs | zodiac-sign |
| version | 0.1.0 |
| created_at | 2024-12-11 21:14:40.634226+00 |
| updated_at | 2024-12-11 21:14:40.634226+00 |
| description | A Rust library enumerating zodiac signs and providing date-based lookups and conversions. |
| homepage | |
| repository | https://github.com/klebs6/klebs-general |
| max_upload_size | |
| id | 1480543 |
| size | 12,491 |
zodiac-sign is a Rust library providing a typed enumeration of the 12 Western astrological zodiac signs, along with utilities for converting from month/day dates, string representations, and iterating through the signs.
Features:
ZodiacSign to/from &str for easy serialization or human-readable output.ZodiacSign::from_month_day).ZodiacSign::date_range).Serialize/Deserialize support via Serde.Example:
use zodiac_sign::ZodiacSign;
use std::str::FromStr;
fn main() {
let sign = ZodiacSign::from_month_day(3, 21).unwrap(); // March 21
println!("March 21 sign: {}", sign); // Aries
let parsed = ZodiacSign::from_str("Leo").unwrap();
println!("Parsed: {}", parsed);
let (start, end) = sign.date_range();
println!("Aries range: {:?} - {:?}", start, end);
}