paft-core
Shared error, enum, and serde building blocks for paft crates.
- Shared enum parsing error (
PaftError) - Canonical string enum macros (
string_enum_*,impl_display_via_code) other_string_code_typefor typed open-enum fallback codes- Serde helpers for timestamp encodings
Install
Most applications should depend on the facade crate:
[]
= "0.9.0"
Advanced (direct dependency, minimal):
[]
= { = "0.9.0", = false }
Use paft-core directly when defining paft-compatible crates or local enum
models that need the macro toolkit.
Features
paft-core has no optional features. Serde support and timestamp helpers are
always available; DataFrame traits live in paft-utils.
Quickstart
use PaftError;
string_enum_closed_with_code!;
impl_display_via_code!;
assert_eq!;
assert_eq!;
assert!;
Open enums with typed Other
Use open enum macros for provider-facing concepts where upstreams can add new
tokens. The typed OtherX wrapper preserves unknown values while rejecting
tokens the enum already models. Unknown tokens are normalized into bounded
canonical strings.
use PaftError;
other_string_code_type!;
string_enum_with_code!;
impl_display_via_code!;
assert_eq!;
assert_eq!;
assert!;
Links
- API docs: https://docs.rs/paft-core
- Workspace overview: https://github.com/paft-rs/paft/blob/main/README.md
- License: LICENSE