use std::{error::Error, fmt};
pub struct PoolFullError<T>(pub(crate) T);
impl<T> PoolFullError<T> {
pub fn into_inner(self) -> T {
self.0
}
}
impl<T> Error for PoolFullError<T> {}
impl<T> fmt::Debug for PoolFullError<T> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str("PoolFullError(..)")
}
}
impl<T> fmt::Display for PoolFullError<T> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str("thread pool is full")
}
}
pub struct CommonAlreadyInitializedError(());
impl CommonAlreadyInitializedError {
pub(crate) fn new() -> Self {
Self(())
}
}
impl Error for CommonAlreadyInitializedError {}
impl fmt::Debug for CommonAlreadyInitializedError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str("CommonAlreadyInitializedError")
}
}
impl fmt::Display for CommonAlreadyInitializedError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str("common thread pool already initialized")
}
}