pub struct WaitlistImpl<T, Value, BlockNumber, Error, OutputError, Callbacks, KeyGen>(/* private fields */)
where
T: DoubleMapStorage<Value = (Value, Interval<BlockNumber>)>,
Error: WaitlistError,
OutputError: From<Error>,
Callbacks: WaitlistCallbacks<Value = Value, BlockNumber = BlockNumber>,
KeyGen: KeyFor<Key = (T::Key1, T::Key2), Value = Value>;Expand description
Waitlist implementation based on DoubleMapStorage.
Generic parameter Error requires WaitlistError implementation.
Generic parameter KeyGen presents key generation for given values.
Generic parameter Callbacks presents actions for success operations
over waitlist.
Trait Implementations§
Source§impl<T, Value, BlockNumber, Error, OutputError, Callbacks, KeyGen> CountedByKey for WaitlistImpl<T, Value, BlockNumber, Error, OutputError, Callbacks, KeyGen>where
T: DoubleMapStorage<Value = (Value, Interval<BlockNumber>)> + CountedByKey<Key = T::Key1>,
Error: WaitlistError,
OutputError: From<Error>,
Callbacks: WaitlistCallbacks<Value = Value, BlockNumber = BlockNumber>,
KeyGen: KeyFor<Key = (T::Key1, T::Key2), Value = Value>,
impl<T, Value, BlockNumber, Error, OutputError, Callbacks, KeyGen> CountedByKey for WaitlistImpl<T, Value, BlockNumber, Error, OutputError, Callbacks, KeyGen>where
T: DoubleMapStorage<Value = (Value, Interval<BlockNumber>)> + CountedByKey<Key = T::Key1>,
Error: WaitlistError,
OutputError: From<Error>,
Callbacks: WaitlistCallbacks<Value = Value, BlockNumber = BlockNumber>,
KeyGen: KeyFor<Key = (T::Key1, T::Key2), Value = Value>,
Source§impl<T, Value, BlockNumber, Error, OutputError, Callbacks, KeyGen> IterableByKeyMap<<T as DoubleMapStorage>::Value> for WaitlistImpl<T, Value, BlockNumber, Error, OutputError, Callbacks, KeyGen>where
T: DoubleMapStorage<Value = (Value, Interval<BlockNumber>)> + IterableByKeyMap<T::Value, Key = T::Key1>,
Error: WaitlistError,
OutputError: From<Error>,
Callbacks: WaitlistCallbacks<Value = Value, BlockNumber = BlockNumber>,
KeyGen: KeyFor<Key = (T::Key1, T::Key2), Value = Value>,
impl<T, Value, BlockNumber, Error, OutputError, Callbacks, KeyGen> IterableByKeyMap<<T as DoubleMapStorage>::Value> for WaitlistImpl<T, Value, BlockNumber, Error, OutputError, Callbacks, KeyGen>where
T: DoubleMapStorage<Value = (Value, Interval<BlockNumber>)> + IterableByKeyMap<T::Value, Key = T::Key1>,
Error: WaitlistError,
OutputError: From<Error>,
Callbacks: WaitlistCallbacks<Value = Value, BlockNumber = BlockNumber>,
KeyGen: KeyFor<Key = (T::Key1, T::Key2), Value = Value>,
Source§type Key = <T as DoubleMapStorage>::Key1
type Key = <T as DoubleMapStorage>::Key1
Map’s first key type.
Source§type DrainIter = <T as IterableByKeyMap<<T as DoubleMapStorage>::Value>>::DrainIter
type DrainIter = <T as IterableByKeyMap<<T as DoubleMapStorage>::Value>>::DrainIter
Removal iterator type.
Source§type Iter = <T as IterableByKeyMap<<T as DoubleMapStorage>::Value>>::Iter
type Iter = <T as IterableByKeyMap<<T as DoubleMapStorage>::Value>>::Iter
Getting iterator type.
Source§impl<T, Value, BlockNumber, Error, OutputError, Callbacks, KeyGen> IterableMap<<T as DoubleMapStorage>::Value> for WaitlistImpl<T, Value, BlockNumber, Error, OutputError, Callbacks, KeyGen>where
T: DoubleMapStorage<Value = (Value, Interval<BlockNumber>)> + IterableMap<T::Value>,
Error: WaitlistError,
OutputError: From<Error>,
Callbacks: WaitlistCallbacks<Value = Value, BlockNumber = BlockNumber>,
KeyGen: KeyFor<Key = (T::Key1, T::Key2), Value = Value>,
impl<T, Value, BlockNumber, Error, OutputError, Callbacks, KeyGen> IterableMap<<T as DoubleMapStorage>::Value> for WaitlistImpl<T, Value, BlockNumber, Error, OutputError, Callbacks, KeyGen>where
T: DoubleMapStorage<Value = (Value, Interval<BlockNumber>)> + IterableMap<T::Value>,
Error: WaitlistError,
OutputError: From<Error>,
Callbacks: WaitlistCallbacks<Value = Value, BlockNumber = BlockNumber>,
KeyGen: KeyFor<Key = (T::Key1, T::Key2), Value = Value>,
Source§type DrainIter = <T as IterableMap<<T as DoubleMapStorage>::Value>>::DrainIter
type DrainIter = <T as IterableMap<<T as DoubleMapStorage>::Value>>::DrainIter
Removal iterator type.
Source§type Iter = <T as IterableMap<<T as DoubleMapStorage>::Value>>::Iter
type Iter = <T as IterableMap<<T as DoubleMapStorage>::Value>>::Iter
Getting iterator type.
Source§impl<T, Value, BlockNumber, Error, OutputError, Callbacks, KeyGen> Waitlist for WaitlistImpl<T, Value, BlockNumber, Error, OutputError, Callbacks, KeyGen>where
T: DoubleMapStorage<Value = (Value, Interval<BlockNumber>)>,
Error: WaitlistError,
OutputError: From<Error>,
Callbacks: WaitlistCallbacks<Value = Value, BlockNumber = BlockNumber>,
KeyGen: KeyFor<Key = (T::Key1, T::Key2), Value = Value>,
impl<T, Value, BlockNumber, Error, OutputError, Callbacks, KeyGen> Waitlist for WaitlistImpl<T, Value, BlockNumber, Error, OutputError, Callbacks, KeyGen>where
T: DoubleMapStorage<Value = (Value, Interval<BlockNumber>)>,
Error: WaitlistError,
OutputError: From<Error>,
Callbacks: WaitlistCallbacks<Value = Value, BlockNumber = BlockNumber>,
KeyGen: KeyFor<Key = (T::Key1, T::Key2), Value = Value>,
Source§type Key1 = <T as DoubleMapStorage>::Key1
type Key1 = <T as DoubleMapStorage>::Key1
First key type.
Source§type Key2 = <T as DoubleMapStorage>::Key2
type Key2 = <T as DoubleMapStorage>::Key2
Second key type.
Source§type BlockNumber = BlockNumber
type BlockNumber = BlockNumber
Block number type. Read more
Source§type OutputError = OutputError
type OutputError = OutputError
Output error type of the waitlist.
Source§fn contains(program_id: &Self::Key1, message_id: &Self::Key2) -> bool
fn contains(program_id: &Self::Key1, message_id: &Self::Key2) -> bool
Returns bool, defining does first key’s waitlist contain second key.
Source§fn insert(
message: Self::Value,
scheduled_at: Self::BlockNumber,
) -> Result<(), Self::OutputError>
fn insert( message: Self::Value, scheduled_at: Self::BlockNumber, ) -> Result<(), Self::OutputError>
Inserts given value in waitlist.
Source§fn remove(
program_id: Self::Key1,
message_id: Self::Key2,
) -> Result<(Self::Value, Interval<Self::BlockNumber>), Self::OutputError>
fn remove( program_id: Self::Key1, message_id: Self::Key2, ) -> Result<(Self::Value, Interval<Self::BlockNumber>), Self::OutputError>
Removes and returns value from waitlist by given keys,
if present, else returns error.
Auto Trait Implementations§
impl<T, Value, BlockNumber, Error, OutputError, Callbacks, KeyGen> Freeze for WaitlistImpl<T, Value, BlockNumber, Error, OutputError, Callbacks, KeyGen>
impl<T, Value, BlockNumber, Error, OutputError, Callbacks, KeyGen> RefUnwindSafe for WaitlistImpl<T, Value, BlockNumber, Error, OutputError, Callbacks, KeyGen>where
T: RefUnwindSafe,
Error: RefUnwindSafe,
OutputError: RefUnwindSafe,
Callbacks: RefUnwindSafe,
KeyGen: RefUnwindSafe,
impl<T, Value, BlockNumber, Error, OutputError, Callbacks, KeyGen> Send for WaitlistImpl<T, Value, BlockNumber, Error, OutputError, Callbacks, KeyGen>
impl<T, Value, BlockNumber, Error, OutputError, Callbacks, KeyGen> Sync for WaitlistImpl<T, Value, BlockNumber, Error, OutputError, Callbacks, KeyGen>
impl<T, Value, BlockNumber, Error, OutputError, Callbacks, KeyGen> Unpin for WaitlistImpl<T, Value, BlockNumber, Error, OutputError, Callbacks, KeyGen>
impl<T, Value, BlockNumber, Error, OutputError, Callbacks, KeyGen> UnwindSafe for WaitlistImpl<T, Value, BlockNumber, Error, OutputError, Callbacks, KeyGen>where
T: UnwindSafe,
Error: UnwindSafe,
OutputError: UnwindSafe,
Callbacks: UnwindSafe,
KeyGen: 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
Source§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
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 moreSource§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
Source§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
Source§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
Source§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
Consume self to return an equivalent value of
T. Read moreSource§impl<T, U> TryIntoKey<U> for Twhere
U: TryFromKey<T>,
impl<T, U> TryIntoKey<U> for Twhere
U: TryFromKey<T>,
type Error = <U as TryFromKey<T>>::Error
fn try_into_key(self) -> Result<U, <U as TryFromKey<T>>::Error>
Source§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
Source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
The counterpart to
unchecked_from.Source§impl<T, S> UniqueSaturatedInto<T> for S
impl<T, S> UniqueSaturatedInto<T> for S
Source§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
Consume self to return an equivalent value of
T.