BufferPoolBuilder

Struct BufferPoolBuilder 

Source
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

Source

pub fn new() -> Self

Create a new BufferPoolBuilder

Source

pub fn set_max_number_of_buffer(&mut self, number: usize) -> &mut Self

Set the maximum of buffer in the pool

Source

pub fn set_min_number_of_buffer(&mut self, number: usize) -> &mut Self

Set the minimum of buffer in the pool

Source

pub fn set_buffer_size(&mut self, number: usize) -> &mut Self

Set the size of each buffer in the pool

Source

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

Source

pub fn build_mono_thread(&self) -> BufferPool

Build a mono thread pool from this builder

Source

pub fn build_multi_thread(&self) -> BufferPool

Build a multi thread pool from this builder

Trait Implementations§

Source§

impl Default for BufferPoolBuilder

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.