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