pub struct MailboxImpl<T, Value, BlockNumber, Error, OutputError, Callbacks, KeyGen>(/* private fields */)
where
T: DoubleMapStorage<Value = (Value, Interval<BlockNumber>)>,
Error: MailboxError,
OutputError: From<Error>,
Callbacks: MailboxCallbacks<OutputError, Value = Value, BlockNumber = BlockNumber>,
KeyGen: KeyFor<Key = (T::Key1, T::Key2), Value = Value>;Expand description
Mailbox implementation based on DoubleMapStorage.
Generic parameter Error requires MailboxError implementation.
Generic parameter KeyGen presents key generation for given values.
Generic parameter Callbacks presents actions for success operations
over mailbox.
Trait Implementations§
Source§impl<T, Value, BlockNumber, Error, OutputError, Callbacks, KeyGen> CountedByKey for MailboxImpl<T, Value, BlockNumber, Error, OutputError, Callbacks, KeyGen>where
T: DoubleMapStorage<Value = (Value, Interval<BlockNumber>)> + CountedByKey<Key = T::Key1>,
Error: MailboxError,
OutputError: From<Error>,
Callbacks: MailboxCallbacks<OutputError, Value = Value, BlockNumber = BlockNumber>,
KeyGen: KeyFor<Key = (T::Key1, T::Key2), Value = Value>,
impl<T, Value, BlockNumber, Error, OutputError, Callbacks, KeyGen> CountedByKey for MailboxImpl<T, Value, BlockNumber, Error, OutputError, Callbacks, KeyGen>where
T: DoubleMapStorage<Value = (Value, Interval<BlockNumber>)> + CountedByKey<Key = T::Key1>,
Error: MailboxError,
OutputError: From<Error>,
Callbacks: MailboxCallbacks<OutputError, 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 MailboxImpl<T, Value, BlockNumber, Error, OutputError, Callbacks, KeyGen>where
T: DoubleMapStorage<Value = (Value, Interval<BlockNumber>)> + IterableByKeyMap<T::Value, Key = T::Key1>,
Error: MailboxError,
OutputError: From<Error>,
Callbacks: MailboxCallbacks<OutputError, 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 MailboxImpl<T, Value, BlockNumber, Error, OutputError, Callbacks, KeyGen>where
T: DoubleMapStorage<Value = (Value, Interval<BlockNumber>)> + IterableByKeyMap<T::Value, Key = T::Key1>,
Error: MailboxError,
OutputError: From<Error>,
Callbacks: MailboxCallbacks<OutputError, 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 MailboxImpl<T, Value, BlockNumber, Error, OutputError, Callbacks, KeyGen>where
T: DoubleMapStorage<Value = (Value, Interval<BlockNumber>)> + IterableMap<T::Value>,
Error: MailboxError,
OutputError: From<Error>,
Callbacks: MailboxCallbacks<OutputError, 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 MailboxImpl<T, Value, BlockNumber, Error, OutputError, Callbacks, KeyGen>where
T: DoubleMapStorage<Value = (Value, Interval<BlockNumber>)> + IterableMap<T::Value>,
Error: MailboxError,
OutputError: From<Error>,
Callbacks: MailboxCallbacks<OutputError, 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> Mailbox for MailboxImpl<T, Value, BlockNumber, Error, OutputError, Callbacks, KeyGen>where
T: DoubleMapStorage<Value = (Value, Interval<BlockNumber>)>,
Error: MailboxError,
OutputError: From<Error>,
Callbacks: MailboxCallbacks<OutputError, Value = Value, BlockNumber = BlockNumber>,
KeyGen: KeyFor<Key = (T::Key1, T::Key2), Value = Value>,
impl<T, Value, BlockNumber, Error, OutputError, Callbacks, KeyGen> Mailbox for MailboxImpl<T, Value, BlockNumber, Error, OutputError, Callbacks, KeyGen>where
T: DoubleMapStorage<Value = (Value, Interval<BlockNumber>)>,
Error: MailboxError,
OutputError: From<Error>,
Callbacks: MailboxCallbacks<OutputError, 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 mailbox.
Source§fn contains(user_id: &Self::Key1, message_id: &Self::Key2) -> bool
fn contains(user_id: &Self::Key1, message_id: &Self::Key2) -> bool
Returns bool, defining does first key’s mailbox 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 mailbox.
Source§fn remove(
user_id: Self::Key1,
message_id: Self::Key2,
) -> Result<(Self::Value, Interval<Self::BlockNumber>), Self::OutputError>
fn remove( user_id: Self::Key1, message_id: Self::Key2, ) -> Result<(Self::Value, Interval<Self::BlockNumber>), Self::OutputError>
Removes and returns value from mailbox by given keys,
if present, else returns error.
Auto Trait Implementations§
impl<T, Value, BlockNumber, Error, OutputError, Callbacks, KeyGen> Freeze for MailboxImpl<T, Value, BlockNumber, Error, OutputError, Callbacks, KeyGen>
impl<T, Value, BlockNumber, Error, OutputError, Callbacks, KeyGen> RefUnwindSafe for MailboxImpl<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 MailboxImpl<T, Value, BlockNumber, Error, OutputError, Callbacks, KeyGen>
impl<T, Value, BlockNumber, Error, OutputError, Callbacks, KeyGen> Sync for MailboxImpl<T, Value, BlockNumber, Error, OutputError, Callbacks, KeyGen>
impl<T, Value, BlockNumber, Error, OutputError, Callbacks, KeyGen> Unpin for MailboxImpl<T, Value, BlockNumber, Error, OutputError, Callbacks, KeyGen>
impl<T, Value, BlockNumber, Error, OutputError, Callbacks, KeyGen> UnwindSafe for MailboxImpl<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.