Enum libqaul::messages::IdType[][src]

pub enum IdType {
    Unique,
    Grouped(Identity),
}

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

Unique

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]

impl Eq for IdType[src]

impl PartialEq<IdType> for IdType[src]

impl Serialize for IdType[src]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WithSubscriber for T[src]