pub struct RMBA<'a, T: 'a + ?Sized>(_, _);
Expand description
RMBA can store an &T, a &mut T, a Box
Note: Drop flags were removed in 1.13-nightly. If you run an earlier version, size might be larger than a single pointer due to the drop flag.
Example
use reffers::RMBA;
use std::{iter, sync};
// Uses Box if only one clone is needed, otherwise uses Arc.
fn make_a_few<'a, T>(t: T, count: usize) -> Vec<RMBA<'a, T>> {
match count {
0 => vec![],
1 => vec![RMBA::new_box(t)],
_ => iter::repeat(sync::Arc::new(t))
.take(count).map(|a| RMBA::from(a)).collect()
}
}
Implementations
Will return a clone if it contains a Arc
Trait Implementations
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more