pub struct BufferPoolBuilder {
pub max_nb_buffer: usize,
pub min_nb_buffer: usize,
pub buffer_size: usize,
pub over_buffer_lifetime_opt: Option<Duration>,
}Expand description
A builder for BufferPool
Fields§
§max_nb_buffer: usize§min_nb_buffer: usize§buffer_size: usize§over_buffer_lifetime_opt: Option<Duration>Implementations§
Source§impl BufferPoolBuilder
impl BufferPoolBuilder
Sourcepub fn set_max_number_of_buffer(&mut self, number: usize) -> &mut Self
pub fn set_max_number_of_buffer(&mut self, number: usize) -> &mut Self
Set the maximum of buffer in the pool
Sourcepub fn set_min_number_of_buffer(&mut self, number: usize) -> &mut Self
pub fn set_min_number_of_buffer(&mut self, number: usize) -> &mut Self
Set the minimum of buffer in the pool
Sourcepub fn set_buffer_size(&mut self, number: usize) -> &mut Self
pub fn set_buffer_size(&mut self, number: usize) -> &mut Self
Set the size of each buffer in the pool
Sourcepub fn set_over_buffer_lifetime(&mut self, new_duration: Duration) -> &mut Self
pub fn set_over_buffer_lifetime(&mut self, new_duration: Duration) -> &mut Self
Only work on Multi-thread pool: Set the maximum inactivity time for excess buffers before being deleted
Sourcepub fn build_mono_thread(&self) -> BufferPool
pub fn build_mono_thread(&self) -> BufferPool
Build a mono thread pool from this builder
Sourcepub fn build_multi_thread(&self) -> BufferPool
pub fn build_multi_thread(&self) -> BufferPool
Build a multi thread pool from this builder
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BufferPoolBuilder
impl RefUnwindSafe for BufferPoolBuilder
impl Send for BufferPoolBuilder
impl Sync for BufferPoolBuilder
impl Unpin for BufferPoolBuilder
impl UnwindSafe for BufferPoolBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more