Expand description
§Zakat Library - Facade Crate
This crate re-exports all functionality from the zakat workspace crates for backward compatibility and convenience.
§Workspace Crates
zakat_core- Core types, traits, and calculatorszakat_i18n- Internationalization and localization (feature:i18n)- [
zakat_ledger] - Event sourcing and Hawl tracking (feature:ledger) zakat_providers- Live price fetching (feature:providers)- [
zakat_sqlite] - SQLite persistence (feature:sqlite)
§Quick Start
ⓘ
use zakat::prelude::*;
let gold = PreciousMetals::gold(100.0)?;
let config = ZakatConfig::default().with_gold_price(65.0)?;
let result = gold.calculate_zakat(&config)?;
println!("Zakat due: {}", result.zakat_due);Modules§
- assets
- Asset Wrapper Types
- config
- Zakat Configuration
- debt
- Debt & Receivables Types (Dayn)
- distribution
- Zakat Distribution (Haddul Kifayah)
- fitrah
- Zakat Fitrah Calculator
- hawl
- Hawl (Lunar Year) Tracker
- i18n
- inputs
- maal
- macros
- Declarative macros for reducing boilerplate in Zakat asset definitions.
- madhab
- Fiqh Compliance: Madhab Strategy Pattern
- math
- partnership
- Fiqh Compliance: Joint Venture & Mixture of Assets (Khultat)
- portfolio
- Fiqh Compliance: Portfolio Aggregation
- prelude
- Prelude module for zakat-core
- pricing
- traits
- types
- utils
- validation
- Validation utilities for Zakat assets.
Macros§
- zakat_
asset - Macro for generating Zakat asset structs with common fields and methods.
- zakat_
ffi_ export - Macro for exporting Zakat assets to FFI (Python, WASM, etc.)
- zakat_
impl_ py_ view - zakat_
pymap_ enum
Structs§
- Cached
Price Provider - A decorator that caches prices for a specified duration.
- Localized
Input - A string input with an explicit locale for unambiguous parsing.
- Prices
- Represents current market prices for metals used in Zakat calculations.
- Static
Price Provider - A static price provider for testing and development.
- Translator
- Translator for multi-locale message translation using Fluent.
- Zakat
Config - Global configuration for Zakat prices.
- Zakat
Details - Represents the detailed breakdown of the Zakat calculation.
- Zakat
Explanation - Structured representation of a Zakat calculation for API consumers.
- Zakat
Portfolio - Zakat
Rules - Rules that govern Zakat calculations for a specific Madhab. Contains Nisab standard, jewelry exemption policy, and Zakat rates.
Enums§
- Input
Locale - Locale specification for unambiguous numeric input parsing.
- Madhab
- Islamic school of thought (Madhab) for Zakat calculation. Each Madhab has different rules regarding Nisab standards and jewelry exemptions.
- Nisab
Standard - Nisab standard for calculating the Zakat threshold on monetary wealth.
- Portfolio
Item - A wrapper enum for all zakatable asset types. This enables serialization and uniform handling in a portfolio.
- Wealth
Type - Helper enum to categorize wealth types
- Zakat
Error - Zakat
Locale - Supported locales for the Zakat library.
Traits§
- Async
Calculate Zakat - Calculate
Zakat - Trait to be implemented by all Zakat calculators.
- Currency
Formatter - Trait for formatting currencies.
- Into
Zakat Decimal - Trait for converting various types into
Decimalfor Zakat calculations. - Price
Provider - Trait for fetching current metal prices.
- Zakat
Config Argument - Helper trait to allow flexible config arguments.
- Zakat
Strategy - Trait for providing Zakat calculation rules.
Functions§
- default_
translator - Creates a default Translator instance.
- with_
locale - Creates a
LocalizedInputfor explicit locale-aware parsing.