pub struct SpendingCounterIncreasing {
nexts: [SpendingCounter; 8],
}
Expand description
Simple strategy to spend from multiple increasing counters
Fields§
§nexts: [SpendingCounter; 8]
Implementations§
source§impl SpendingCounterIncreasing
impl SpendingCounterIncreasing
pub fn new_from_counter(set: SpendingCounter) -> Self
pub fn new_from_counters(nexts: [SpendingCounter; 8]) -> Result<Self, Error>
pub fn get_valid_counter(&self) -> SpendingCounter
pub fn get_valid_counters(&self) -> [SpendingCounter; 8]
sourcepub fn next_verify(&mut self, counter: SpendingCounter) -> Result<(), Error>
pub fn next_verify(&mut self, counter: SpendingCounter) -> Result<(), Error>
try to match the lane of the counter in argument, if it doesn’t match an error reported.
If the counter match succesfully, then the counter at this lane is incremented by one.
sourcepub(crate) fn next_unchecked(&mut self, unchecked_counter: SpendingCounter)
pub(crate) fn next_unchecked(&mut self, unchecked_counter: SpendingCounter)
Increases the spending counter on the given lane.
Trait Implementations§
source§impl Arbitrary for SpendingCounterIncreasing
impl Arbitrary for SpendingCounterIncreasing
source§impl Clone for SpendingCounterIncreasing
impl Clone for SpendingCounterIncreasing
source§fn clone(&self) -> SpendingCounterIncreasing
fn clone(&self) -> SpendingCounterIncreasing
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for SpendingCounterIncreasing
impl Debug for SpendingCounterIncreasing
source§impl Default for SpendingCounterIncreasing
impl Default for SpendingCounterIncreasing
source§impl Display for SpendingCounterIncreasing
impl Display for SpendingCounterIncreasing
source§impl PartialEq<SpendingCounterIncreasing> for SpendingCounterIncreasing
impl PartialEq<SpendingCounterIncreasing> for SpendingCounterIncreasing
source§fn eq(&self, other: &SpendingCounterIncreasing) -> bool
fn eq(&self, other: &SpendingCounterIncreasing) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for SpendingCounterIncreasing
impl StructuralEq for SpendingCounterIncreasing
impl StructuralPartialEq for SpendingCounterIncreasing
Auto Trait Implementations§
impl RefUnwindSafe for SpendingCounterIncreasing
impl Send for SpendingCounterIncreasing
impl Sync for SpendingCounterIncreasing
impl Unpin for SpendingCounterIncreasing
impl UnwindSafe for SpendingCounterIncreasing
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