Skip to main content

merge_availability

Function merge_availability 

Source
pub fn merge_availability(
    streams: &[EventStream],
    window_start: DateTime<Utc>,
    window_end: DateTime<Utc>,
    privacy: PrivacyLevel,
) -> UnifiedAvailability
Expand description

Merge N event streams into unified availability within a time window.

All events from all streams are flattened, clipped to the window, and merged into non-overlapping busy blocks. Free slots are the gaps between busy blocks.

When privacy is Opaque, source_count is set to 0 on all busy blocks — no information about how many calendars contributed leaks through.

§Arguments

  • streams — The event streams to merge (from different calendars/providers).
  • window_start — Start of the time window to analyze.
  • window_end — End of the time window to analyze.
  • privacy — Controls whether source count is included in busy blocks.