paft-core

Crates.iopaft-core
lib.rspaft-core
version0.7.1
created_at2025-09-15 22:52:29.64351+00
updated_at2025-10-31 17:55:59.233258+00
descriptionCore domain types, errors, and shared utilities for paft.
homepagehttps://github.com/paft-rs/paft
repositoryhttps://github.com/paft-rs/paft
max_upload_size
id1840665
size26,276
G. Ramistella (gramistella)

documentation

https://docs.rs/paft-core

README

paft-core

Core infrastructure utilities for the paft ecosystem.

Crates.io Docs.rs

  • Workspace-wide error type (PaftError)
  • Enum macros for canonical string codes (string_enum_*, impl_display_via_code)
  • Reusable serde helpers for timestamp encodings
  • Optional re-exports for lightweight DataFrame traits

Install

Prefer the facade crate for most applications:

[dependencies]
paft = "0.7.1"

Advanced (direct dependency, minimal):

[dependencies]
paft-core = { version = "0.7.1", default-features = false }

With serde helpers only (no optional features available in this crate):

[dependencies]
paft-core = { version = "0.7.1", default-features = false }

Features

This crate does not expose optional features as of 0.5.2. DataFrame traits now live in paft-utils and are forwarded by consumer crates (or the paft facade) via their own dataframe features.

Quickstart

use paft_core::{PaftError, string_enum_closed_with_code, impl_display_via_code};

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
enum Side { Buy, Sell }

paft_core::string_enum_closed_with_code!(
    Side, "Side",
    { "BUY" => Side::Buy, "SELL" => Side::Sell }
);
paft_core::impl_display_via_code!(Side);

assert_eq!(Side::Buy.code(), "BUY");
assert_eq!("sell".parse::<Side>().unwrap(), Side::Sell);
assert!(matches!("".parse::<Side>(), Err(PaftError::InvalidEnumValue { .. })));

Links

Commit count: 38

cargo fmt