Skip to main content

lookup

Function lookup 

pub fn lookup(s: &str) -> Result<Arc<dyn Calendar>, CalendarParseError>
Expand description

Resolves a lookup string to a calendar.

Comma-joins are memoized process-wide: the joint calendar’s business-day grid is built at most once per distinct expression, and subsequent lookups return the shared handle. Single codes resolve through the per-center caches and skip the memo’s synchronization entirely.

§Errors

CalendarParseError::Malformed for an empty code or a token with a character outside letters, digits and dots, and the error resolve_one reports for a token naming no known center or market.

§Panics

If the process-wide memo’s lock is poisoned — that is, if another thread panicked while holding it. The memo guards a cache of built calendars and nothing else, so a poisoned lock means an earlier failure elsewhere.