[−][src]Trait seq_io::policy::BufPolicy
Policy that configures how the internal buffer grows upon encountering large sequences that don't fit into the current buffer.
Required methods
fn grow(&mut self, current_size: usize) -> usize
Takes the current buffer size in bytes and returns the new size the the buffer should grow to. This function is called every time the buffer has to be enlarged.
Provided methods
fn limit(&self) -> Option<usize>
Returns a buffer limit, if any. Called every time the buffer has to be
enlarged. If the new buffer size (as calculated based on the call to
grow()
) exceeds the given limit, the readers will return an error
of ErrorKind::BufferLimit
.
fn grow_limited(&mut self, current_size: usize) -> Option<usize>
Combines grow()
and limit()
into one call. Takes the current buffer
size and returns the new size, unless it is larger than the limit.