#[non_exhaustive]pub enum MessageResult {
Delivered {
response: String,
},
Failed(ServerError),
Refused(ServerError),
NotSent {
reason: String,
},
}Expand description
What became of a message you sent.
A message can fail in three different places and this crate keeps them apart, because the right response differs: a message that never left this client can be retried immediately, one the server refused will be refused again, and one the Metadata Adapter rejected is an application-level answer.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Delivered
The Metadata Adapter processed the message without raising
[docs/spec/04-notifications.md §4.1].
Fields
Failed(ServerError)
The message reached the server but was not delivered, or the Metadata
Adapter failed while processing it
[docs/spec/04-notifications.md §4.2].
Appendix B codes 32, 33, 38 and 39 concern the sequence
numbering specifically — a progressive already used, or one skipped
because the server stopped waiting for it
[docs/spec/05-error-codes.md §2].
Refused(ServerError)
The server refused the request outright, so no delivery outcome will
ever follow [docs/spec/03-requests.md §13.2].
NotSent
The message never reached the server.
Messages are not buffered and not resent. A subscription is a statement of desired state and is safely re-created on whatever session comes next; a message is a one-shot side effect whose ordering and deduplication the server tracks per session. Replaying one across a session replacement would restart the numbering the server deduplicates against, so this crate fails the send rather than promise an ordering it cannot keep. Whether to retry is yours to decide, because you are the only one who can decide it correctly.
Trait Implementations§
Source§impl Clone for MessageResult
impl Clone for MessageResult
Source§fn clone(&self) -> MessageResult
fn clone(&self) -> MessageResult
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more