lockfree_object_pool/
none_reusable.rs
1use std::ops::{Deref, DerefMut};
2
3#[allow(unused_imports)]
4use crate::none_object_pool::NoneObjectPool;
5
6pub struct NoneReusable<T> {
20 data: T,
21}
22
23impl<T> NoneReusable<T> {
24 #[inline]
29 pub fn new(data: T) -> Self {
30 Self { data }
31 }
32}
33
34impl<T> DerefMut for NoneReusable<T> {
35 #[inline]
36 fn deref_mut(&mut self) -> &mut Self::Target {
37 &mut self.data
38 }
39}
40
41impl<T> Deref for NoneReusable<T> {
42 type Target = T;
43
44 #[inline]
45 fn deref(&self) -> &Self::Target {
46 &self.data
47 }
48}