pub enum SyncDelivery {
Delivered {
event_id: String,
relay_url: String,
slot_id: String,
},
Duplicate {
event_id: String,
relay_url: String,
slot_id: String,
},
DeliveredNostr {
event_id: String,
relay_url: String,
npub: String,
},
PeerUnknown {
event_id: String,
},
SlotStale {
event_id: String,
relay_url: String,
slot_id: String,
detail: String,
},
TransportError {
event_id: String,
relay_url: String,
slot_id: String,
detail: String,
},
}Expand description
Result of attempting a synchronous delivery to a peer.
Variants§
Delivered
Relay accepted the event. First-time landing on the peer’s slot.
Duplicate
Relay said duplicate — same event_id already on the slot.
Not a failure: the relay HAS the event, the peer can pull it.
Surfaced distinctly so the caller can decide whether to nudge
content uniqueness on the next attempt.
DeliveredNostr
Delivered over the peer’s Nostr transport (RFC-007 D3): no HTTP slot
was reachable, but the peer has a recorded nostr_transport and the
relay accepted the published NIP-01 event. npub is the peer’s x-only
transport key the event was p-tagged to. Counts as relay-reached: the
peer can pull it with wire nostr fetch.
PeerUnknown
Peer isn’t in relay_state.peers — no slot coords to POST to.
This is the explicit “you haven’t paired yet” case. The
caller should either suggest wire dial <peer> or write
to outbox via the --queue opt-in.
SlotStale
Relay returned a 4xx/410 — slot has rotated, token expired,
peer half-paired and never completed bilateral. The caller
surfaces a hint to wire dial <peer>.
TransportError
Transport failure (TLS, DNS, connect timeout, 5xx). The
caller decides whether to fall back to --queue or surface
the error.
Implementations§
Source§impl SyncDelivery
impl SyncDelivery
Sourcepub fn status_str(&self) -> &'static str
pub fn status_str(&self) -> &'static str
Compact status string for callers that just want the verdict.
Same shape as the JSON status field.
Sourcepub fn reached_relay(&self) -> bool
pub fn reached_relay(&self) -> bool
True when the event reached the relay (Delivered or Duplicate). Both states mean the peer CAN pull it.
pub fn event_id(&self) -> &str
Trait Implementations§
Source§impl Clone for SyncDelivery
impl Clone for SyncDelivery
Source§fn clone(&self) -> SyncDelivery
fn clone(&self) -> SyncDelivery
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more