pub fn split_off(&mut self, at: usize) -> RangeBuf {
        assert!(
            at <= self.len,
            "`at` split index (is {}) should be <= len (is {})",
            at,
            self.len
        );

        let buf = RangeBuf {
            data: self.data.clone(),
            start: self.start + at,
            pos: cmp::max(self.pos, self.start + at),
            len: self.len - at,
            off: self.off + at as u64,
            fin: self.fin,
        };

        self.pos = cmp::min(self.pos, self.start + at);
        self.len = at;
        self.fin = false;

        buf
    }
/// Splits the buffer into two at the given index.
Splits the buffer into two at the given index.
Splits the buffer into two at the given index .
pub fn split_off(&mut self, at: usize) -> RangeBuf {
        assert!(
            at <= self.len,
            "`at` split index (is {}) should be <= len (is {})",
            at,
            self.len
        );
        let buf = RangeBuf {
            data: self.data.clone(),
            start: self.start + at,
            pos: cmp::max(self.pos, self.start + at),
            len: self.len - at,
            off: self.off + at as u64,
            fin: self.fin,
        };
        self.pos = cmp::min(self.pos, self.start + at);
        self.len = at;
        self.fin = false;
        buf
    }
pub fn split_off ( & mut self , at : usize ) -> RangeBuf { assert ! ( at self len " " at self len ) ; let buf = RangeBuf { data : self . data . clone ( ) , start : self . start + at , pos : cmp :: max ( self . pos , self . start + at ) , len : self . len - at , off : self . off + at as u64 , fin : self . fin , } ; self . pos = cmp :: min ( self . pos , self . start + at ) ; self . len = at ; self . fin = false ; buf }
Splits the buffer into two at the given index.
Splits the buffer into two at the given index .
&mut self
at
usize
&mut self
at
usize