1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
//! The imports a service on Pulsar writes every time, in one glob.
//!
//! `use ruststream_pulsar::prelude::*;` carries the core's own prelude plus this crate's broker,
//! subscription descriptor and its options, positions, per-delivery context keys, the publish
//! policy under its concept name [`Publish`], the [`PulsarPublishSteps`] step and the capability
//! traits [`Positioned`] and [`Seeker`]. The
//! [Prelude](https://powersemmi.github.io/ruststream-pulsar/latest/components/broker/prelude/)
//! page shows it in a service.
//!
//! # Two vocabularies, two files
//!
//! A handler body imports `ruststream::prelude::*` and bounds an injected slot with the
//! **capability trait** it needs, `Out<impl Publisher>`, so it names no broker type at all. A
//! mount site imports this prelude, where the policy reads [`Publish`] as it does on every
//! broker. One handler body imports this prelude too: the one that names the
//! [`partition_key`](PulsarPublishSteps::partition_key) step, which needs the trait in scope and
//! the slot bounded as `Out<impl Publisher<Options = PulsarPublishOptions>, Marker>`.
//!
//! Globbing two broker preludes conflicts on `Publish` where it is used (E0659); the prefixed
//! [`PulsarPublish`](crate::PulsarPublish) at the crate root is the disambiguation.
//!
//! # Examples
//!
//! ```
//! # mod demo {
//! use ruststream_pulsar::prelude::*;
//! use serde::{Deserialize, Serialize};
//!
//! #[derive(Deserialize)]
//! struct Order {
//! id: u64,
//! }
//!
//! #[derive(Outgoing, Serialize)]
//! #[outgoing(name = "receipts")]
//! struct Receipt {
//! id: u64,
//! }
//!
//! #[subscriber(
//! PulsarSubscription::new("orders", "workers").subscription_type(SubscriptionType::Shared),
//! reply
//! )]
//! async fn confirm(order: &Order) -> Receipt {
//! Receipt { id: order.id }
//! }
//!
//! #[ruststream::app]
//! fn app() -> impl App {
//! RustStream::new(AppInfo::new("orders", "0.1.0")).with_broker(
//! PulsarBroker::new("pulsar://localhost:6650"),
//! |b| {
//! b.include(confirm)
//! .out_reply(Publish)
//! .max_attempts(nonzero!(5))
//! .dead_letter("orders-dlq");
//! },
//! )
//! }
//! # }
//! # fn main() {}
//! ```
pub use *;
pub use ;
pub use cratePulsarPublish as Publish;
pub use crate::;
// `Partitioned` stays out: the core surfaces `partition_key` through `IncomingMessage`'s
// defaulted method, so re-exporting the trait makes the natural call ambiguous (E0034).