pub struct Enqueued { /* private fields */ }Expand description
The outbox inserts one Notifier::notify produced.
Append Enqueued::statements to the caller’s own db.batch_atomic(..).
Nothing is written until that batch runs.
Implementations§
Source§impl Enqueued
impl Enqueued
Sourcepub fn statements(&self) -> &[Statement]
pub fn statements(&self) -> &[Statement]
The INSERTs to append to the caller’s batch, in subscription
order.
Sourcepub fn into_statements(self) -> Vec<Statement>
pub fn into_statements(self) -> Vec<Statement>
The statements, consumed.
Sourcepub fn notification_id(&self) -> &str
pub fn notification_id(&self) -> &str
The id shared by every row of this fan-out, and carried to the
device in data.notification_id so a client that is reached on
two devices can dedupe.
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
How many devices this notification will be attempted on.
Devices, not statements: the batch may also carry the in-app inbox insert, which is not a send.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Whether nothing will be sent. An inbox row may still be written —
see Enqueued::wrote_inbox — and an extra channel may still have
a row queued — see Enqueued::channel_rows.
Sourcepub fn channel_rows(&self) -> usize
pub fn channel_rows(&self) -> usize
How many extra-channel rows are in the batch (#764). One per registered channel that could reach the account — account level, whatever the account’s devices are doing.
Sourcepub fn wrote_inbox(&self) -> bool
pub fn wrote_inbox(&self) -> bool
Whether the batch carries an in-app inbox row (#187).
Independent of Enqueued::is_empty: the inbox is written for an
account with no device and for one whose push preference is off,
because those switch off push, not the record.
Sourcepub fn has_missing_translations(&self) -> bool
pub fn has_missing_translations(&self) -> bool
Whether the catalog could not render part of this message (#190).
The notification is still queued — with the message id as its text,
so it is visible from both ends — and
Notifier::announce says so on the bus.