pub fn send(&mut self, data: &mut [u8]) -> Option<(StreamPos, StreamPos)> {
        let send_amt = (self.buffer.len() - self.sent as usize).min(data.len()) as u32;
        if send_amt == 0 {
            None
        } else {
            for i in 0..send_amt as usize {
                data[i] = self.buffer[i + self.sent as usize];
            }
            let start = self.send_pos;
            let end = start + Wrapping(send_amt);

            self.sent += send_amt;
            self.send_pos = end;
            self.unacked_ranges.push((start, end));

            Some((start, end))
        }
    }
/// Send any pending written data up to the size of the provided buffer, and add this sent range
/// as an unacked range.
///
/// Returns the stream range of the sent data.  Not all of the provided buffer is necessarily
/// written, only the data from the start of the buffer to the length of the returned stream
/// range is actually written.  Will not return a zero sized range, if no data is available to
/// be sent or the provided buffer is empty, will return None.
Send any pending written data up to the size of the provided buffer, and add this sent range
as an unacked range.

Returns the stream range of the sent data.  Not all of the provided buffer is necessarily
written, only the data from the start of the buffer to the length of the returned stream
range is actually written.  Will not return a zero sized range, if no data is available to
be sent or the provided buffer is empty, will return None.
Send any pending written data up to the size of the provided buffer and add this sent range as an unacked range . Returns the stream range of the sent data . Not all of the provided buffer is necessarily written only the data from the start of the buffer to the length of the returned stream range is actually written . Will not return a zero sized range if no data is available to be sent or the provided buffer is empty will return None .
pub fn send(&mut self, data: &mut [u8]) -> Option<(StreamPos, StreamPos)> {
        let send_amt = (self.buffer.len() - self.sent as usize).min(data.len()) as u32;
        if send_amt == 0 {
            None
        } else {
            for i in 0..send_amt as usize {
                data[i] = self.buffer[i + self.sent as usize];
            }
            let start = self.send_pos;
            let end = start + Wrapping(send_amt);
            self.sent += send_amt;
            self.send_pos = end;
            self.unacked_ranges.push((start, end));
            Some((start, end))
        }
    }
pub fn send ( & mut self , data : & mut [ u8 ] ) -> Option < ( StreamPos , StreamPos ) > { let send_amt = ( self . buffer . len ( ) - self . sent as usize ) . min ( data . len ( ) ) as u32 ; if send_amt == 0 { None } else { for i in 0 .. send_amt as usize { data [ i ] = self . buffer [ i + self . sent as usize ] ; } let start = self . send_pos ; let end = start + Wrapping ( send_amt ) ; self . sent += send_amt ; self . send_pos = end ; self . unacked_ranges . push ( ( start , end ) ) ; Some ( ( start , end ) ) } }
Send any pending written data up to the size of the provided buffer, and add this sent range
as an unacked range.
Send any pending written data up to the size of the provided buffer and add this sent range as an unacked range .
&mut self
data
&mut [u8]
&mut self
data
&mut [u8]