ThreadArg

Trait ThreadArg 

Source
pub trait ThreadArg {
    const NAME: &'static str;
    const LONG_NAME: &'static str;
    const HELP: &'static str;

    // Required method
    fn default() -> usize;

    // Provided methods
    fn bounded_default() -> usize { ... }
    fn min() -> usize { ... }
    fn max() -> usize { ... }
    fn range() -> RangeInclusive<usize> { ... }
}
Expand description

Configuration for CLAP arguments that control the number of threads for various functions

Required Associated Constants§

Source

const NAME: &'static str

The argument’s name

Source

const LONG_NAME: &'static str

The argument’s long name

Source

const HELP: &'static str

The argument’s help message

Required Methods§

Source

fn default() -> usize

The default number of threads

Provided Methods§

Source

fn bounded_default() -> usize

The default number of threads, bounded by Self::max() This prevents potential CLAP issues on low core count machines where a fixed value in Self::default() could be greater than Self::max()

Source

fn min() -> usize

The minimum allowed number of threads (inclusive)

Source

fn max() -> usize

The maximum allowed number of threads (inclusive)

Source

fn range() -> RangeInclusive<usize>

The range of allowed number of threads (inclusive on both ends)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl ThreadArg for RocksdbCompactionThreadsArg

Source§

const NAME: &'static str = "rocksdb_compaction_threads"

Source§

const LONG_NAME: &'static str = "rocksdb-compaction-threads"

Source§

const HELP: &'static str = "Number of threads to use for rocksdb (Blockstore) compactions"

Source§

impl ThreadArg for RocksdbFlushThreadsArg

Source§

const NAME: &'static str = "rocksdb_flush_threads"

Source§

const LONG_NAME: &'static str = "rocksdb-flush-threads"

Source§

const HELP: &'static str = "Number of threads to use for rocksdb (Blockstore) memtable flushes"