pub fn set<R: RangeBounds<usize>>(&mut self, range: R) {
        let start = match range.start_bound() {
            Bound::Included(n) => *n,
            Bound::Excluded(n) => *n + 1,
            Bound::Unbounded => 0,
        };
        let end = match range.end_bound() {
            Bound::Included(n) => *n + 1,
            Bound::Excluded(n) => *n,
            Bound::Unbounded => self.inner.as_ref().len(),
        };

        assert!(end <= self.inner.as_ref().len());
        assert!(start <= end);

        self.range.start = start;
        self.range.end = end;
    }
Changes the range of this window to the range specified.

# Panics

This method will panic if `range` is out of bounds for the underlying
slice or if [`start_bound()`] of `range` comes after the [`end_bound()`].

[`start_bound()`]: std::ops::RangeBounds::start_bound
[`end_bound()`]: std::ops::RangeBounds::end_bound
futures-util/src/io/window.rs