Skip to main content

Crate use_thread_name

Crate use_thread_name 

Source
Expand description

§use-thread-name

Primitive thread name and thread count vocabulary.

use-thread-name models thread names and non-zero thread counts as plain values. It does not name actual running threads, create threads, manage threads, or replace std::thread.

use use_thread_name::{ThreadCount, ThreadName};

let name = ThreadName::new("worker").unwrap();
let count = ThreadCount::new(4).unwrap();

assert_eq!(name.as_str(), "worker");
assert_eq!(count.get(), 4);

Structs§

ThreadCount
A non-zero thread count.
ThreadName
A non-empty thread name value.

Enums§

ThreadCountError
Errors returned while constructing thread counts.
ThreadNameError
Errors returned while constructing thread names.