Enum libqaul::messages::IdType [−][src]
Specify the id type for a message dispatch
Because libqaul doesn’t implement recipient groups it’s up to a service to create useful categorisations for groups of users. This means that a service might send the same message to different users, that are then receiving technically different messages. This can cause all sorts of issues for services because now the database is keeping track of a message many times (for each user it was sent to).
This is what this type aims to circumvent: a message id can be randomised during delivery, or fixed as a group to ensure that a set of messages are all assigned the same Id.
This comes with some caveats: when inserting into the database, the message Id will already exist, and so further messages will not be stored. If you are using the grouped constraint on an unequal message set (meaning that payloads differ), this will result in data loss!
Variants
A unique message ID will be generated on dispatch
Grouped(Identity)
Create a grouped message ID constraint
Implementations
impl IdType
[src]
pub fn consume(self) -> Identity
[src]
pub fn group(id: Identity) -> IdType
[src]
Create an ID type that is constrained for a group
pub fn create_group() -> IdType
[src]
Create a new message group with a random Id
pub fn unique() -> IdType
[src]
Create a new message ID for every message dispatched
Trait Implementations
impl Clone for IdType
[src]
impl Copy for IdType
[src]
impl Debug for IdType
[src]
impl<'de> Deserialize<'de> for IdType
[src]
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<IdType, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
[src]
__deserializer: __D
) -> Result<IdType, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
impl Eq for IdType
[src]
impl PartialEq<IdType> for IdType
[src]
impl Serialize for IdType
[src]
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
[src]
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
impl StructuralEq for IdType
[src]
impl StructuralPartialEq for IdType
[src]
Auto Trait Implementations
impl RefUnwindSafe for IdType
impl Send for IdType
impl Sync for IdType
impl Unpin for IdType
impl UnwindSafe for IdType
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,
pub fn vzip(self) -> V
impl<T> WithSubscriber for T
[src]
pub fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
[src]
S: Into<Dispatch>,