Identified appointment spans in source-label order. The window selects
starts; duration may extend beyond it. IDs preserve the series and source.
Start and end interpretation share one zone-work budget per call.
new_with_endings supports source-specific duration or explicit-end overrides.
Example
Use this layer when each recurrence start should become an identified span.
Coordinate measures POSIX microseconds; Calendar applies calendar components,
resolves the end, then adds its coordinate tail. The window selects starts,
not every appointment overlapping that window.
This example supplies a finite UTC rules snapshot. Applications using named
zones can pass rules from the optional zone-data package instead. For a complete
application with calendar-month durations and an extra booking, see
equipment loans.
When a batch returns Limited, process its partial output and resume the returned
cursor with sufficient budgets. Increasing only the output cap does not fix a
work or buffer limit.
Start an identified appointment query with one default duration and explicit start
context. The window selects source starts; endings may extend beyond it. Invalid
duration/window errors are checked before consumption.
Override durations at original source positions, including explicit
inclusions. This does not add starts: configure those on the rule.
Exclusions still win; overrides do not replenish COUNT or change IDs.
At most 4096 inputs, sorted once in O(n log n), then O(log n) lookup.
Identical definitions coalesce; conflicting definitions at one position
return ConflictingDuration, even outside the query or at excluded starts.
Calendar and coordinate definitions remain distinct despite equal widths.
Override a source with a duration or explicit end, without adding starts.
The same 4096-entry limit and positional lookup apply. Equal definitions
coalesce; different definitions at one position return ConflictingEnding.
Endpoint order is checked after the start and end are interpreted.
Advanced construction from checked ending definitions. Duration validation
and override normalization are not repeated; query state is fresh.
This carries no persistence semantics. Use ScheduleDefinition for ordinary
reusable declarations that also retain their explicit context and origin.
next : TimedSchedule(id), Limits -> Try(Next(id), Error)
At most one start advancement and one end advancement. A pending end
resumes before consuming another start. Steps count source-candidate
work; constructing a duration adds only bounded calendar arithmetic.
Start buffers and the pending end's zone candidates have separate caps.
Return a bounded diagnostic summary without advancing cursors or enumerating occurrences.
Use typed accessors for application logic; this text is not a storage format.
Checked normalized ending definitions for advanced prepared scheduling.
Construction validates duration and normalizes at most 4096 overrides once;
no zone resolution or recurrence expansion. This is not a storage format.
Check and normalize up to 4096 source-specific ending overrides. Duplicate equal endings
collapse; conflicting endings for one source return ConflictingEnding.
new : Duration, List(Entry) -> Try(Endings, [InvalidDuration, TooManyOverrides, ConflictingEnding(LocalDateTime), ..])
Validate the positive default duration and normalize ending overrides once for reuse
across queries. Does not resolve zones or enumerate starts.
Replace the ending of one original source label with duration, explicit boundary or
explicit local-end intent. Equal resolved boundaries do not merge source identities.
Malformed duration, invalid window, unavailable zone interpretation or range failure.
Resource exhaustion is represented separately by a Limited result.