[−][src]Struct kompact::net::buffers::BufferConfig
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]
P: Into<PathBuf>,
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]
fn clone(&self) -> BufferConfig
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[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
- chunk_size default value is
128 000
. - initial_chunk_count default value is
2
. - max_chunk_count default value is
1 000
. - encode_buf_min_free_space is
64
.
impl Eq for BufferConfig
[src]
impl PartialEq<BufferConfig> for BufferConfig
[src]
fn eq(&self, other: &BufferConfig) -> bool
[src]
fn ne(&self, other: &BufferConfig) -> bool
[src]
impl StructuralEq for BufferConfig
[src]
impl StructuralPartialEq for BufferConfig
[src]
Auto Trait Implementations
impl RefUnwindSafe for BufferConfig
impl Send for BufferConfig
impl Sync for BufferConfig
impl Unpin for BufferConfig
impl UnwindSafe for BufferConfig
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[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]
U: From<T>,
impl<T> SendSyncUnwindSafe for T where
T: Send + Sync + UnwindSafe + ?Sized,
[src]
T: Send + Sync + UnwindSafe + ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,