[][src]Trait heaparray::naive_rc::ref_counters::RefCounter

pub trait RefCounter<T> {
    fn new(data: T) -> Self;
fn decrement(&self) -> usize;
fn increment(&self) -> usize;
fn counter(&self) -> usize;
fn get_data(&self) -> &T;
fn get_data_mut(&mut self) -> &mut T; }

Utility struct that handles reference counting.

Required methods

fn new(data: T) -> Self

Returns a new instance of this reference counter

fn decrement(&self) -> usize

Decrements the reference counter by one and returns its current value

fn increment(&self) -> usize

Increments the reference counter by one and returns its current value

fn counter(&self) -> usize

fn get_data(&self) -> &T

fn get_data_mut(&mut self) -> &mut T

Loading content...

Implementors

impl<T> RefCounter<T> for ArcStruct<T>[src]

impl<T> RefCounter<T> for RcStruct<T>[src]

Loading content...