Expand description
Expiration time helpers.
Convenience functions for generating ISO 8601 expiration timestamps,
matching the Expires module in the TypeScript SDK.
§Examples
use mpp::expires;
let five_min = expires::minutes(5);
let one_hour = expires::hours(1);
let one_week = expires::weeks(1);Functions§
- assert
- Assert that an expiration timestamp is present, well-formed, and not in the past.
- days
- Returns an ISO 8601 datetime string
ndays from now. - hours
- Returns an ISO 8601 datetime string
nhours from now. - minutes
- Returns an ISO 8601 datetime string
nminutes from now. - months
- Returns an ISO 8601 datetime string
nmonths (30 days each) from now. - seconds
- Returns an ISO 8601 datetime string
nseconds from now. - weeks
- Returns an ISO 8601 datetime string
nweeks from now. - years
- Returns an ISO 8601 datetime string
nyears (365 days each) from now.