Skip to main content

ruststream_kinesis/
lib.rs

1#![doc = include_str!("README.md")]
2#![forbid(unsafe_code)]
3
4mod broker;
5mod claim;
6mod clients;
7mod context;
8mod cursor;
9#[cfg(feature = "dynamodb-lease")]
10mod dynamo;
11mod error;
12#[cfg(feature = "testing")]
13mod in_process;
14mod lease;
15mod message;
16pub mod prelude;
17mod publisher;
18mod stream;
19mod subscriber;
20mod track;
21
22/// Restricts the crate's mount-site publish settings to the crate's own policies: the arguments
23/// they carry mean something only to a transport that reads them back.
24#[doc(hidden)]
25pub mod sealed {
26    /// The crate's publish policy behind a bound.
27    ///
28    /// [`KinesisPublishSettings`](crate::KinesisPublishSettings) is one blanket impl over the
29    /// mount chain, bounded on the policy the chain named, so the settings appear after this
30    /// crate's policy and after no other broker's.
31    #[diagnostic::on_unimplemented(
32        message = "`{Self}` is not a Kinesis publish policy",
33        note = "a Kinesis publish setting rides the position named right before it: \
34                `.out_reply(Publish::default()).partition_key(\"tenant-acme\")`"
35    )]
36    pub trait PolicyKey: Sized {
37        /// Names the record's partition key on this policy.
38        #[must_use]
39        fn with_partition_key(self, key: String) -> Self;
40    }
41}
42
43pub use broker::{ConnectedKinesisBroker, KinesisBroker};
44pub use context::{KinesisBatchContext, KinesisContext, Position, SeekHandle};
45#[cfg(feature = "dynamodb-lease")]
46pub use dynamo::DynamoLeaseStore;
47pub use error::KinesisError;
48pub use lease::{LeaseError, LeaseKey, LeaseState, LeaseStore, MemoryLeaseStore, SHARD_END};
49pub use message::{
50    KinesisMessage, KinesisPosition, PARTITION_KEY_HEADER, SEQUENCE_HEADER, SHARD_HEADER,
51};
52pub use publisher::{
53    KinesisPublish, KinesisPublishOptions, KinesisPublishSettings, KinesisPublishSteps,
54    KinesisPublisher,
55};
56pub use stream::{KinesisStream, KinesisSubscriberExt};
57pub use subscriber::{KinesisSeeker, KinesisSubscriber};