[][src]Struct kompact::net::buffers::BufferConfig

pub struct BufferConfig { /* fields omitted */ }

The configuration for the network buffers

Implementations

impl BufferConfig[src]

pub fn from_config(config: &Hocon) -> Self[src]

Tries to deserialise a configuration instance from the specified in the given config.

Returns the same values as BufferConfig::default if it fails to read from the config.

pub fn from_config_file<P>(path: P) -> BufferConfig where
    P: Into<PathBuf>, 
[src]

Tries to deserialise a BufferConfig from a HOCON file at path

Returns the same values as BufferConfig::default if it fails to read from the config.

Panics

Panics if it fails to load the file or fails to load the file as HOCON.

pub fn chunk_size(&mut self, size: usize)[src]

Sets the chunk_size to the given number of bytes.

Specifies the size in bytes of each BufferChunk instance produced by pools using this configuration.

Must be at least 128 bytes, and must also be greater than encode_buf_min_free_space.

pub fn initial_chunk_count(&mut self, count: usize)[src]

Sets the initial_chunk_count to the given number.

Specifies the number of BufferChunk instances that pools using this configuration create initially.

May be at most the value of max_chunk_count.

pub fn max_chunk_count(&mut self, count: usize)[src]

Sets the max_chunk_count to the given number.

Specifies the maximum number of BufferChunk instances that pools using this configuration may create.

Must be at least the value of initial_chunk_count.

pub fn encode_buf_min_free_space(&mut self, size: usize)[src]

Sets the encode_buf_min_free_space to the given number of bytes.

This sets the minimum number of bytes an EncodeBuffer must have available before attempting any serialisation into it.

Must be less than chunk_size.

pub fn validate(&self)[src]

Performs basic sanity checks on the config parameters and panics if it is invalid.

This method is called automatically by any BufferPool on creation.

Trait Implementations

impl Clone for BufferConfig[src]

impl Debug for BufferConfig[src]

impl Default for BufferConfig[src]

fn default() -> Self[src]

Create a new configuration with default values which may then be overwritten

impl Eq for BufferConfig[src]

impl PartialEq<BufferConfig> for BufferConfig[src]

impl StructuralEq for BufferConfig[src]

impl StructuralPartialEq for BufferConfig[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Erased for T[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SendSyncUnwindSafe for T where
    T: Send + Sync + UnwindSafe + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,