zodiac-sign

Crates.iozodiac-sign
lib.rszodiac-sign
version
sourcesrc
created_at2024-12-11 21:14:40.634226
updated_at2024-12-11 21:14:40.634226
descriptionA Rust library enumerating zodiac signs and providing date-based lookups and conversions.
homepage
repositoryhttps://github.com/klebs6/klebs-general
max_upload_size
id1480543
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`
size0
(klebs6)

documentation

https://docs.rs/zodiac-sign

README

zodiac-sign

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:

  • Enumerates all 12 zodiac signs: Aries through Pisces.
  • Convert ZodiacSign to/from &str for easy serialization or human-readable output.
  • Determine a sign from a given month/day combination (ZodiacSign::from_month_day).
  • Access the canonical date range for each sign (ZodiacSign::date_range).
  • Iterate through all signs.
  • 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);
}

Commit count: 248

cargo fmt