pub trait SendBuffer: Buffer {
    // Required methods
    fn mark_read(&mut self, count: usize);
    fn peek_with<'a, F, R>(&'a mut self, offset: usize, f: F) -> R
       where F: FnOnce(SendPayload<'a>) -> R;
}
Expand description

A buffer supporting TCP sending operations.

Required Methods§

source

fn mark_read(&mut self, count: usize)

Removes count bytes from the beginning of the buffer as already read.

§Panics

Panics if more bytes are marked as read than are available, i.e., count > self.len.

source

fn peek_with<'a, F, R>(&'a mut self, offset: usize, f: F) -> R
where F: FnOnce(SendPayload<'a>) -> R,

Calls f with contiguous sequences of readable bytes in the buffer without advancing the reading pointer.

§Panics

Panics if more bytes are peeked than are available, i.e., offset > self.len

Object Safety§

This trait is not object safe.

Implementors§