pub struct Sequence<T>{ /* private fields */ }Expand description
A module that stores a single value in the storage that can be read or incremented.
Implementations§
Source§impl<T> Sequence<T>
impl<T> Sequence<T>
Sourcepub fn get_current_value(&self) -> T
pub fn get_current_value(&self) -> T
Returns the current value of the sequence.
Sourcepub fn next_value(&mut self) -> T
pub fn next_value(&mut self) -> T
Increments the value of the sequence and returns the new value.
Trait Implementations§
Source§impl<T: Num + One + Zero + Default + Copy + ToBytes + FromBytes + CLTyped> ModuleComponent for Sequence<T>
Implements the ModuleComponent trait for the Sequence struct.
impl<T: Num + One + Zero + Default + Copy + ToBytes + FromBytes + CLTyped> ModuleComponent for Sequence<T>
Implements the ModuleComponent trait for the Sequence struct.
Source§impl<T> Revertible for Sequence<T>
impl<T> Revertible for Sequence<T>
impl<T: Num + One + Zero + Default + Copy + ToBytes + FromBytes + CLTyped> ModulePrimitive for Sequence<T>
Auto Trait Implementations§
impl<T> Freeze for Sequence<T>
impl<T> !RefUnwindSafe for Sequence<T>
impl<T> !Send for Sequence<T>
impl<T> !Sync for Sequence<T>
impl<T> Unpin for Sequence<T>where
T: Unpin,
impl<T> !UnwindSafe for Sequence<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
Source§impl<M> HasEvents for Mwhere
M: ModulePrimitive,
impl<M> HasEvents for Mwhere
M: ModulePrimitive,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more