|
|
@ -1,9 +1,10 @@ |
|
|
|
use std::fmt::{Display, Error, Formatter};
|
|
|
|
use std::num::NonZeroUsize;
|
|
|
|
use std::path::Path;
|
|
|
|
|
|
|
|
#[derive(Clone, Debug, PartialEq, Hash, Eq)]
|
|
|
|
pub struct FpmPoolConfig {
|
|
|
|
max_children: usize,
|
|
|
|
max_children: NonZeroUsize,
|
|
|
|
custom: Option<String>,
|
|
|
|
}
|
|
|
|
|
|
|
@ -19,14 +20,14 @@ impl Display for FpmPoolConfig { |
|
|
|
impl From<usize> for FpmPoolConfig {
|
|
|
|
fn from(max_children: usize) -> Self {
|
|
|
|
Self {
|
|
|
|
max_children,
|
|
|
|
max_children: NonZeroUsize::try_from(max_children).unwrap(),
|
|
|
|
custom: None,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl FpmPoolConfig {
|
|
|
|
pub fn new(max_children: usize, custom: impl Into<String>) -> Self {
|
|
|
|
pub fn new(max_children: NonZeroUsize, custom: impl Into<String>) -> Self {
|
|
|
|
Self {
|
|
|
|
max_children,
|
|
|
|
custom: Some(custom.into()),
|
|
|
|