Struct ts_mem_pool::arc_recycled::ArcRecycled [−][src]
pub struct ArcRecycled<T: Recycle> { /* fields omitted */ }
A smart pointer that returns memory to its owner when it is dropped
Methods
impl<T: Recycle> ArcRecycled<T>
[src]
impl<T: Recycle> ArcRecycled<T>
pub fn new(data: T, owner_channel: Sender<Option<T>>) -> ArcRecycled<T>
[src]
pub fn new(data: T, owner_channel: Sender<Option<T>>) -> ArcRecycled<T>
Constructor function, takes the memory slot and the channel to the pool
pub fn get_ref(&self) -> &T
[src]
pub fn get_ref(&self) -> &T
Returns a reference to the content. Deref can be used instead
pub fn get_mut(&mut self) -> Option<&mut T>
[src]
pub fn get_mut(&mut self) -> Option<&mut T>
Returns a mutable reference to the content, if this is the only owner, if not returns None
Trait Implementations
impl<T: Debug + Recycle> Debug for ArcRecycled<T>
[src]
impl<T: Debug + Recycle> Debug for ArcRecycled<T>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<T: Recycle> Clone for ArcRecycled<T>
[src]
impl<T: Recycle> Clone for ArcRecycled<T>
fn clone(&self) -> ArcRecycled<T>
[src]
fn clone(&self) -> ArcRecycled<T>
Normal clone, but it is better explicited here.
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl<T: Recycle> Drop for ArcRecycled<T>
[src]
impl<T: Recycle> Drop for ArcRecycled<T>
impl<T: Recycle> Deref for ArcRecycled<T>
[src]
impl<T: Recycle> Deref for ArcRecycled<T>
type Target = T
The resulting type after dereferencing.
fn deref(&self) -> &T
[src]
fn deref(&self) -> &T
Give a reference directly to the innermost content
impl<T: Recycle> DerefMut for ArcRecycled<T>
[src]
impl<T: Recycle> DerefMut for ArcRecycled<T>
Auto Trait Implementations
impl<T> Send for ArcRecycled<T> where
T: Send + Sync,
impl<T> Send for ArcRecycled<T> where
T: Send + Sync,
impl<T> !Sync for ArcRecycled<T>
impl<T> !Sync for ArcRecycled<T>