paginator-rs
A modular Rust library providing a reusable trait for paginating any serializable collection. Built using Cargo workspace structure for flexibility and clarity.
๐งฑ Workspace Structure
root/
โโโ paginator/ # Main trait and implementation logic
โ โโโ src/lib.rs
โ โโโ Cargo.toml
โโโ paginator-utils/ # Shared types and helper functions (e.g. response format)
โ โโโ src/lib.rs
โ โโโ Cargo.toml
โโโ paginator-examples/ # Usage examples and test cases
โ โโโ src/lib.rs
โ โโโ src/examples/
โ โโโ Cargo.toml
โโโ Cargo.toml # Root workspace config
โโโ README.md
โจ Features
PaginatorTrait<T>for consistent pagination logicPaginatorResponse<T>as a standardized response structure- JSON serialization support using
serde - Clean separation of logic, utilities, and examples
๐ฆ Installation
To use in your project, add this to your Cargo.toml:
[]
= { = "https://github.com/maulanasdqn/paginator-rs" }
= { = "1", = ["derive"] }
= "1"
This project will be published to crates.io soon ๐
๐ Usage Example
use ;
use ;
๐งช Sample Output
๐ License
MIT ยฉ 2025 Maulana Sodiqin