[][src]Struct lockfree_object_pool::MutexReusable

pub struct MutexReusable<'a, T> { /* fields omitted */ }

Wrapper over T used by MutexObjectPool.

Access is allowed with std::ops::Deref or std::ops::DerefMut

Example

 use lockfree_object_pool::MutexObjectPool;

 let pool = MutexObjectPool::<u32>::new(
   ||  Default::default(),
   |v| {
     *v = 0;
   }
 );
 let mut item = pool.pull();

 *item = 5;
 let work = *item * 5;

Implementations

impl<'a, T> MutexReusable<'a, T>[src]

pub fn new(pool: &'a MutexObjectPool<T>, data: ManuallyDrop<T>) -> Self[src]

Create new element

Arguments

  • pool object pool owner
  • data element to wrap

Trait Implementations

impl<'a, T> Deref for MutexReusable<'a, T>[src]

type Target = T

The resulting type after dereferencing.

impl<'a, T> DerefMut for MutexReusable<'a, T>[src]

impl<'a, T> Drop for MutexReusable<'a, T>[src]

Auto Trait Implementations

impl<'a, T> !RefUnwindSafe for MutexReusable<'a, T>[src]

impl<'a, T> Send for MutexReusable<'a, T> where
    T: Send
[src]

impl<'a, T> Sync for MutexReusable<'a, T> where
    T: Send + Sync
[src]

impl<'a, T> Unpin for MutexReusable<'a, T> where
    T: Unpin
[src]

impl<'a, T> !UnwindSafe for MutexReusable<'a, T>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.