pub struct Mlsp<T> { /* private fields */ }Expand description
A hybrid between Rc and Arc that attempts to reduce the number of atomic operations performed when it is shared, cloned and dropped within a thread.
Mlsp cannot be sent between threads.
ⓘ
let a = mlsp::Mlsp::new(1u8);
thread::spawn(move || {
let a2 = a;
});To send across thread boundaries, first package using the package() method
and send the resulting package.
let a = mlsp::Mlsp::new(1u8);
let a_pkg = a.package();
thread::spawn(move || {
let a2 = a_pkg.unpackage();
});Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Mlsp<T>
impl<T> !RefUnwindSafe for Mlsp<T>
impl<T> !Send for Mlsp<T>
impl<T> !Sync for Mlsp<T>
impl<T> Unpin for Mlsp<T>
impl<T> !UnwindSafe for Mlsp<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more