[−][src]Struct reffers::rmba::RMBA
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() } }
Methods
impl<'a, T: 'a> RMBA<'a, T>
[src]
impl<'a, T: 'a + ?Sized> RMBA<'a, T>
[src]
pub fn new<A: Into<RMBA<'a, T>>>(t: A) -> RMBA<'a, T>
[src]
pub fn try_clone(&self) -> Option<RMBA<'a, T>>
[src]
Will return a clone if it contains a Arc
pub fn get_mut(&mut self) -> Option<&mut T>
[src]
Will return a &mut to inner contents if it contains a &mut T, a Box
Trait Implementations
impl<'a, T: ?Sized> AReffic for RMBA<'a, T>
[src]
impl<'a, T: 'a + ?Sized + Send> Send for RMBA<'a, T>
[src]
impl<'a, T: 'a + ?Sized> Drop for RMBA<'a, T>
[src]
impl<'a, T: 'a + ?Sized> AsRef<T> for RMBA<'a, T>
[src]
impl<'a, T: 'a + ?Sized> From<&'a T> for RMBA<'a, T>
[src]
impl<'a, T: 'a + ?Sized> From<&'a mut T> for RMBA<'a, T>
[src]
impl<'a, T: 'a + ?Sized> From<Box<T>> for RMBA<'a, T>
[src]
impl<'a, T: 'a + ?Sized> From<Arc<T>> for RMBA<'a, T>
[src]
impl<'a, T: 'a + ?Sized + Eq> Eq for RMBA<'a, T>
[src]
impl<'a, T: ?Sized + Ord> Ord for RMBA<'a, T>
[src]
fn cmp(&self, other: &Self) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
1.21.0[src]
fn clamp(self, min: Self, max: Self) -> Self
[src]
impl<'a, T: 'a + ?Sized + PartialEq> PartialEq<RMBA<'a, T>> for RMBA<'a, T>
[src]
impl<'a, T: 'a + ?Sized + PartialOrd> PartialOrd<RMBA<'a, T>> for RMBA<'a, T>
[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]
fn lt(&self, other: &Self) -> bool
[src]
fn le(&self, other: &Self) -> bool
[src]
fn gt(&self, other: &Self) -> bool
[src]
fn ge(&self, other: &Self) -> bool
[src]
impl<'a, T: 'a + ?Sized> Debug for RMBA<'a, T>
[src]
impl<'a, T: 'a + ?Sized> Deref for RMBA<'a, T>
[src]
impl<'a, T: 'a + ?Sized + Hash> Hash for RMBA<'a, T>
[src]
fn hash<H>(&self, state: &mut H) where
H: Hasher,
[src]
H: Hasher,
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<'a, T: 'a + ?Sized> Borrow<T> for RMBA<'a, T>
[src]
impl<'a, T: 'a + ?Sized> StableDeref for RMBA<'a, T>
[src]
Auto Trait Implementations
impl<'a, T> !Sync for RMBA<'a, T>
impl<'a, T: ?Sized> Unpin for RMBA<'a, T>
impl<'a, T> !UnwindSafe for RMBA<'a, T>
impl<'a, T: ?Sized> RefUnwindSafe for RMBA<'a, T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T> Repr for T
[src]
type Store = T
fn convert(*mut T) -> *mut T
[src]
unsafe fn deallocate_mem<M>(&mut UnsafeCell<RCell<<T as Repr>::Store, M>>) where
M: BitMask,
[src]
M: BitMask,
impl<T> Repr for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,