Skip to main content

aster_forge_api/
lib.rs

1//! Shared API response and pagination helpers for Aster services.
2//!
3//! This crate contains small HTTP-facing types that are useful across service boundaries:
4//! bounded limit query parsing, limit/offset pagination, cursor-page response shapes, cursor
5//! validation helpers, overfetch trimming, and simple sort-order serialization. It deliberately
6//! avoids depending on any concrete web framework or product entity so handlers can adapt it to
7//! Axum, Actix, `OpenAPI` generation, or test-only fixtures.
8#![cfg_attr(
9    not(test),
10    deny(
11        clippy::unwrap_used,
12        clippy::unreachable,
13        clippy::expect_used,
14        clippy::panic,
15        clippy::unimplemented,
16        clippy::todo
17    )
18)]
19
20mod cursor;
21mod error;
22mod pagination;
23mod patch;
24/// Typed, framework-neutral REST response envelopes.
25pub mod response;
26mod schema;
27mod sort;
28
29pub use cursor::{
30    CreatedAtCursorQuery, CursorPage, CursorSlice, DateTimeIdCursor, DateTimeStringCursor,
31    EnabledPriorityIdCursor, IdCursor, SortOrderNameIdCursor, StringIdCursor, UpdatedAtCursorQuery,
32    parse_datetime_id_cursor, parse_datetime_string_cursor, parse_enabled_priority_id_cursor,
33    parse_id_cursor, parse_sort_order_name_id_cursor, parse_string_id_cursor,
34};
35pub use error::{ApiError, Result};
36pub use pagination::{
37    DEFAULT_FILE_LIMIT, DEFAULT_FOLDER_LIMIT, DEFAULT_PAGE_LIMIT, LimitOffsetQuery, LimitQuery,
38    MAX_PAGE_SIZE, OffsetPage, load_offset_page,
39};
40pub use patch::{NullablePatch, deserialize_nullable_patch_option};
41#[doc(hidden)]
42pub use schema::ApiSchema;
43pub use sort::SortOrder;