pub struct CounterValue<Model: IModel> { /* private fields */ }
Implementations§
Source§impl<Model: IModel> CounterValue<Model>
impl<Model: IModel> CounterValue<Model>
pub const fn new(suffix: u8) -> Self
pub fn increment(&self, model: &mut Model) -> Result<(), StorageError>
Sourcepub fn decrement(&self, model: &mut Model) -> Result<bool, StorageError>
pub fn decrement(&self, model: &mut Model) -> Result<bool, StorageError>
returns true if the counter reached zero, and the property was removed
pub fn get(&self, model: &mut Model) -> Result<u64, StorageError>
pub fn del(&self, model: &mut Model) -> Result<(), StorageError>
Trait Implementations§
Source§impl<Model: IModel> ISingleValueColumn for CounterValue<Model>
impl<Model: IModel> ISingleValueColumn for CounterValue<Model>
Auto Trait Implementations§
impl<Model> Freeze for CounterValue<Model>
impl<Model> RefUnwindSafe for CounterValue<Model>where
Model: RefUnwindSafe,
impl<Model> Send for CounterValue<Model>where
Model: Send,
impl<Model> Sync for CounterValue<Model>where
Model: Sync,
impl<Model> Unpin for CounterValue<Model>where
Model: Unpin,
impl<Model> UnwindSafe for CounterValue<Model>where
Model: UnwindSafe,
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