Skip to main content

Module lookup

Module lookup 

Expand description

Calendar lookup DSL.

Resolves a code string to a calendar: a business-centre code, or a comma-separated list joined into the union of their holidays. Examples: "GBLO", "GBLO,EUTA". A settlement calendar is not part of the expression: it is an argument of the SettlementLag.

StructsΒ§

CalendarSpec
A calendar stated as data, for ingestion: the code it binds, the holidays it closes, and the weekdays that are not business days.

EnumsΒ§

CalendarIngestError
Why a calendar could not be ingested.
CalendarParseError
Error resolving a calendar-lookup string.

StaticsΒ§

ANY_INGESTED πŸ”’
Whether any calendar has been ingested β€” the guard that keeps the binding table off the resolution path of a process that never ingests.
INGEST_GENERATION πŸ”’
Bumped, under the composite cache’s lock, by every ingest and clear: a composite built across a bump is not cached.

FunctionsΒ§

bindings πŸ”’
bound πŸ”’
The calendar ingested under the canonical code, if any β€” what a shipped centre’s or market’s own calendar() answers before its table, so every path that reaches a shipped calendar honours an override.
canonical_code πŸ”’
The canonical code a lookup token resolves under: an alias of a shipped centre or market reads as that centre’s code, anything else upper-cased.
center
Resolves a center code to a calendar, panicking on a wiring error.
composite_cache πŸ”’
The process-wide composite-expression cache. Calendars are immutable, so an entry is invalidated only when a calendar is ingested under a code the expression names; the expression universe is the closed set of template calendar strings, so the map stays small.
ingest_calendar
Binds spec.code to a calendar built from spec, process-wide.
ingest_calendars
Ingests every spec in order; a later spec for the same code wins.
ingested πŸ”’
ingested_calendars
The codes ingested this process, sorted β€” what a run records to say which calendars it overrode or added.
is_well_formed_code πŸ”’
Whether a token is a well-formed calendar code: non-empty after trimming and made only of ASCII letters, digits and dots. This one rule decides what lookup accepts as a member and what ingest_calendar accepts as a code, so a stray character is refused the same way wherever it appears.
join πŸ”’
Resolves a comma-separated list to a single calendar (joining by union of holidays when there is more than one member).
lookup
Resolves a lookup string to a calendar.
reserved_codes πŸ”’
The reserved codes lookup resolves ahead of the registry, for a rejection to name alongside the registered centres. The one place the spellings are written: resolve_reserved and the ingestion guard both read them from here, so what is advertised is what resolves.
resolve_one πŸ”’
Resolves a single token to a calendar: a bare FpML code (or alias) yields the jurisdiction settlement calendar; a qualified BASE.SUFFIX code (or a market alias such as nyse) yields the market calendar. A calendar ingested under the code β€” or under the canonical code an alias spells β€” answers first.
resolve_reserved πŸ”’
The two rule-based calendars, reachable by a reserved code so that the whole substrate is namable in one expression language.

Type AliasesΒ§

Bindings πŸ”’
The calendar bindings ingested this process: canonical code β†’ calendar.
CompositeCache πŸ”’
The composite-expression cache’s storage: expression string β†’ compiled calendar.