Crates.io | zodiac-sign |
lib.rs | zodiac-sign |
version | |
source | src |
created_at | 2024-12-11 21:14:40.634226 |
updated_at | 2024-12-11 21:14:40.634226 |
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 |
Cargo.toml error: | TOML parse error at line 24, column 1 | 24 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
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);
}