ENH: 'Efficient' resampling with custom non-uniform non-overlapping time intervals
#### Is your feature request related to a problem?

I would like to resample a sorted time series with a sorted list of non-uniform, non-overlapping and not necessarily contiguous time intervals.
Taking benefit that...
* the time serie i sorted
* and and the non-uniform not necessarily contiguous time intervals are not overlapping,

...reading through the time serie needs to be done only once.

[Posting my question on SO](https://stackoverflow.com/questions/67250482/efficient-groupby-when-rows-of-groups-are-contiguous), with use of `groupby` just to show intended result, and asking if this could be done 'more efficiently' in pandas, I have been proposed to use Numba. 

#### Describe the solution you'd like

I would propose to:
- re-use [`IntervalIndex`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.IntervalIndex.html) to define non-uniform, sorted and non overlapping intervals. This feature can conveniently be checked then with `is_non_overlapping_monotonic`
- have a new parameter `label` in `IntervalIndex` to define how should be named each interval (left or right bound, similar to `resample` API)
- have [`resample`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.resample.html) accepting `IntervalIndex`
- have the parameters `closed` and `label` forwarded from `IntervalIndex` to `resample`

Additionally, `resample` could also accept a single sequence of timestamps to define sorted non-uniform **contiguous** time intervals, similar to what [`cut`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.cut.html) can accept for its `bins` parameter.

#### API breaking implications

Use case example.
```python
import pandas as pd

# Time series.
length = 14
ts = pd.date_range(start='2021/01/01 08:00', periods=length, freq='30T')
tseries = pd.DataFrame({'val':range(length)}, index=ts)

# Custom disjoint intervals.
hours_start = ['7:46', '9:25',  '9:35', '10:15', '10:55', '13:10']
hours_end  = ['8:43', '9:32', '10:09', '10:42', '12:55', '13:31']
days = ['2021/01/01']*len(hours_start)
start = pd.DatetimeIndex(map(pd.Timestamp, map(' '.join, zip(days, hours_start))))
end = pd.DatetimeIndex(map(pd.Timestamp, map(' '.join, zip(days, hours_end))))
custom_intervals = pd.IntervalIndex.from_arrays(start, end, closed='left')

# New API here, with 'closed' and 'label' parameters forwarded from 'IntervalIndex' to 'resample'.
tseries['cumsum'] = tseries['val'].resample(custom_intervals).agg({'val': 'cumsum'})['val']
```


#### Describe alternatives you've considered

* using Numba of course
* using `rolling`. Am I right in thinking that `resample` is a convenience method calling `rolling` under the hood?

#### Additional context

I am assuming that `resample` already takes benefit that the time series is sorted according its DatetimeIndex. Am I right?
