use std::marker::PhantomData;
use crate::{DropPolicy, PinnedPool};
#[derive(Debug)]
#[must_use]
pub struct PinnedPoolBuilder<T> {
drop_policy: DropPolicy,
_item: PhantomData<T>,
}
impl<T> PinnedPoolBuilder<T> {
pub(crate) fn new() -> Self {
Self {
drop_policy: DropPolicy::default(),
_item: PhantomData,
}
}
pub fn drop_policy(mut self, policy: DropPolicy) -> Self {
self.drop_policy = policy;
self
}
#[must_use]
pub fn build(self) -> PinnedPool<T> {
PinnedPool::new_inner(self.drop_policy)
}
}