Expand description
Rate-limit segment family. Renders the 5-hour and 7-day usage
windows from ctx.usage() per docs/specs/rate-limit-segments.md.
See format for the shared render helpers, and the per-window
files (five_hour, five_hour_reset, seven_day, seven_day_reset)
for the four Segment impls. The dispatcher in segments::mod.rs
wires the user-facing [segments.rate_limit_*] config keys to the
segment structs re-exported below.
Re-exports§
pub use five_hour::RateLimit5hResetSegment;pub use five_hour::RateLimit5hSegment;pub use seven_day::RateLimit7dResetSegment;pub use seven_day::RateLimit7dSegment;
Modules§
- config
- Config types and TOML-extras parsers for the rate-limit segment
family. The
CommonRateLimitConfigstruct, family-shared format enums, andapply_common_extras/parse_*_formathelpers all live here. Render-time helpers (format_percent,format_duration,render_error, etc.) live informat. - five_
hour - 5-hour rate-limit segments: utilization (
RateLimit5hSegment) and reset countdown (RateLimit5hResetSegment). Both readctx.usage()(Arc<Result<UsageData, UsageError>>) and route through theUsageWindow::FiveHourseam insuper::window. - format
- Render helpers for the rate-limit segment family. TOML-parsing,
the
CommonRateLimitConfigstruct, and the format enums live in theconfigsibling. - seven_
day - 7-day rate-limit segments: utilization (
RateLimit7dSegment) and reset countdown (RateLimit7dResetSegment). Both mirror thefive_hoursegments but readdata.seven_day. - window
- [
UsageWindow] and the per-windowresolve_*_resetfunctions collapse the (Endpoint vs JSONL) match dance for the four rate-limit segments into typed calls. Without this seam, each segment open-codes the same nested match againstUsageData, differing only in window selector (five_hourvsseven_day) and hide-reason wording.