| Crates.io | apithing |
| lib.rs | apithing |
| version | 0.1.0 |
| created_at | 2025-09-01 12:40:23.758726+00 |
| updated_at | 2025-09-01 12:40:23.758726+00 |
| description | A standardized API approach based on content and prop traits |
| homepage | https://github.com/swissarmyhammer/apithing |
| repository | https://github.com/swissarmyhammer/apithing |
| max_upload_size | |
| id | 1819555 |
| size | 84,390 |
A standardized API approach based on content and prop traits.
ApiThing provides a trait-based framework for building consistent, type-safe APIs using shared contexts and parameter objects. The framework enables you to define operations that are composable, testable, and maintainable while enforcing consistent patterns across different API families.
cargo add apithing
Read (./examples/basic_usage.rs)
ApiThing is built around several key concepts:
graph TB
Context["Context (C)<br/>• Shared state<br/>• Resources<br/>• Connections"]
Operation["ApiOperation<C,P><br/>fn execute()<br/>→ Output<br/>→ Error"]
Parameters["Parameters (P)<br/>• Input params<br/>• Validation<br/>• Type safety"]
Execute["Execute<C,P><br/>execute_on()<br/>(ergonomic API)"]
ApiExecutor["ApiExecutor<C><br/>• Stateful<br/>• Context mgmt<br/>• Multi-ops"]
Context --> Operation
Parameters --> Operation
Operation --> Execute
Execute --> ApiExecutor
ApiOperation<C, P> trait with execute() methodThe repository includes several comprehensive examples:
Run examples with:
cargo run --example basic_usage
cargo run --example executor_pattern
cargo run --example advanced_patterns