[−][src]Struct crndm::cell::VCell
A persistent memory location containing a volatile data
The underlying data is valid throughout of the course of a single pool
lifetime. When the pool is reopened, the data is back to its default value.
Type T
in VCell<T>
should implement Default
and VSafe
.
Examples
use crndm::default::*; use std::cell::RefCell; type P = BuddyAlloc; #[derive(Default)] struct Root { v: VCell<RefCell<i32>> } let root = P::open::<Root>("foo.pool", O_CF).unwrap(); P::transaction(|j| { let mut v = root.v.borrow_mut(); assert_eq!(*v, i32::default()); *v = 20; // This value is volatile and resets on restart }).unwrap();
Implementations
impl<T: Default + VSafe, A: MemPool> VCell<T, A>
[src]
Trait Implementations
impl<T: Default + VSafe, A: MemPool> Default for VCell<T, A>
[src]
impl<T: Default + VSafe, A: MemPool> Deref for VCell<T, A>
[src]
impl<T: Default + VSafe, A: MemPool> DerefMut for VCell<T, A>
[src]
impl<T: Default + VSafe + ?Sized, A: MemPool> Drop for VCell<T, A>
[src]
impl<T: Default + VSafe + Eq + Copy, A: MemPool> Eq for VCell<T, A>
[src]
impl<T: Default + VSafe + Ord + Copy, A: MemPool> Ord for VCell<T, A>
[src]
pub fn cmp(&self, other: &VCell<T, A>) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl<T: Default + VSafe + ?Sized, A: MemPool> PSafe for VCell<T, A>
[src]
impl<T: Default + VSafe + PartialEq + Copy, A: MemPool> PartialEq<T> for VCell<T, A>
[src]
impl<T: Default + VSafe + PartialEq + Copy, A: MemPool> PartialEq<VCell<T, A>> for VCell<T, A>
[src]
pub fn eq(&self, other: &VCell<T, A>) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<T: Default + VSafe + PartialOrd + Copy, A: MemPool> PartialOrd<T> for VCell<T, A>
[src]
pub fn partial_cmp(&self, other: &T) -> Option<Ordering>
[src]
pub fn lt(&self, other: &T) -> bool
[src]
pub fn le(&self, other: &T) -> bool
[src]
pub fn gt(&self, other: &T) -> bool
[src]
pub fn ge(&self, other: &T) -> bool
[src]
impl<T: Default + VSafe + PartialOrd + Copy, A: MemPool> PartialOrd<VCell<T, A>> for VCell<T, A>
[src]
pub fn partial_cmp(&self, other: &VCell<T, A>) -> Option<Ordering>
[src]
pub fn lt(&self, other: &VCell<T, A>) -> bool
[src]
pub fn le(&self, other: &VCell<T, A>) -> bool
[src]
pub fn gt(&self, other: &VCell<T, A>) -> bool
[src]
pub fn ge(&self, other: &VCell<T, A>) -> bool
[src]
impl<T: Default + VSafe + ?Sized, A: MemPool> Send for VCell<T, A>
[src]
Safe to transfer between thread boundaries
impl<T, A: MemPool> !Sync for VCell<T, A>
[src]
Not safe for thread data sharing
Auto Trait Implementations
impl<T, A> LooseTxInUnsafe for VCell<T, A> where
A: LooseTxInUnsafe,
T: LooseTxInUnsafe,
[src]
A: LooseTxInUnsafe,
T: LooseTxInUnsafe,
impl<T, A> RefUnwindSafe for VCell<T, A> where
A: RefUnwindSafe,
T: RefUnwindSafe,
[src]
A: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, A> !TxInSafe for VCell<T, A>
[src]
impl<T, A> !TxOutSafe for VCell<T, A>
[src]
impl<T, A> Unpin for VCell<T, A> where
A: Unpin,
T: Unpin,
[src]
A: Unpin,
T: Unpin,
impl<T, A> UnwindSafe for VCell<T, A> where
A: UnwindSafe,
T: RefUnwindSafe + UnwindSafe,
[src]
A: UnwindSafe,
T: RefUnwindSafe + UnwindSafe,
impl<T, A> VSafe for VCell<T, A> where
A: VSafe,
[src]
A: VSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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.
pub 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.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,