use std::fmt::{Debug, Formatter, Result};
use std::thread::Builder;
pub struct Settings(Builder);
impl Settings {
#[inline]
pub fn new() -> Self {
Self(Builder::new())
}
#[inline]
pub fn name<T: ToString>(self, name: T) -> Self {
Self(self.0.name(name.to_string()))
}
#[inline]
pub fn stack_size(self, size: usize) -> Self {
Self(self.0.stack_size(size))
}
#[inline]
pub(crate) fn into_inner(self) -> Builder {
self.0
}
}
impl Default for Settings {
#[inline]
fn default() -> Self {
Self::new()
}
}
impl Debug for Settings {
#[inline]
fn fmt(&self, f: &mut Formatter<'_>) -> Result {
write!(f, "{:?}", self.0)
}
}