Skip to main content

Crate haste_subscription

Crate haste_subscription 

Source
Expand description

The single source of truth for what each [SubscriptionTier] allows.

Everything a tier permits lives in the TIERS table below: the request budget the rate limiter enforces, the resource caps the tenant tier limits middleware enforces, whether a tenant may set its own name and logo, and the commercial facts (price, SLA, support response) the pricing page publishes.

Nothing else in the workspace should hardcode a per-tier number. The server’s subscription_limits modules read this table, and cargo run subscription export writes it to the website as JSON so the published prices cannot drift from the enforced limits.

Modules§

export
Serializes crate::TIERS for the website’s pricing page.

Structs§

OperationPoints
What one request costs against a tier’s daily budget.
TierLimits
Everything one subscription tier allows, and how it is sold.

Enums§

RequestBudget
A tier’s daily request budget, in OPERATION_POINTS.
ResourceLimit
How many resources of one type a tenant may store.

Constants§

DEFAULT_TIER
The tier every hosted signup starts on.
OPERATION_POINTS
The cost of each kind of request, in budget points.
TIERS
Every tier, in the order the pricing page presents them.

Functions§

allows_tenant_customization
Whether a tier may set a tenant display name and logo.
limits_for
The limits for a tier.
resource_limit_for
The cap on one resource type for a tier, or ResourceLimit::Unlimited for the types a tier does not cap individually.