osproxy_sink/lib.rs
1//! Write sink.
2//!
3//! Where writes go, isolated from how routing is decided
4//! (`docs/decisions/008`). The [`Sink`] trait is the seam: `OpenSearchSink`
5//! writes directly to a cluster, and the future queue-based redundancy mode is a
6//! `QueueSink` drop-in behind the same trait. Epoch stamping is carried on every
7//! [`WriteOp`] at this boundary (`docs/06` ยง2).
8//!
9//! M1 ships the [`Sink`] trait, the [`WriteBatch`]/[`WriteAck`] vocabulary, an
10//! in-memory [`MemorySink`] for tests and dry-run, and the [`OpenSearchSink`]
11//! that writes directly to a cluster over a pooled HTTP connection. M2 adds the
12//! [`Reader`] seam for get-by-id reads (kept separate because a read is always
13//! direct-to-cluster, a redundancy `QueueSink` can absorb writes but cannot
14//! answer a read); both `MemorySink` and `OpenSearchSink` implement it.
15#![deny(missing_docs)]
16
17mod ack;
18mod batch;
19mod breaker;
20mod conn;
21mod error;
22mod memory;
23mod opensearch;
24mod read;
25mod sink;
26mod trace_headers;
27mod wire;
28
29pub use ack::{OpResult, WriteAck};
30pub use batch::{DocOp, WriteBatch, WriteOp};
31pub use conn::PoolStats;
32pub use error::SinkError;
33pub use memory::MemorySink;
34pub use opensearch::{buffered, stream_body, BodyError, ByteBody, OpenSearchSink};
35pub use read::{
36 CountOutcome, CursorOp, CursorOutcome, ForwardOp, ReadOp, ReadOutcome, Reader, SearchOp,
37 SearchOutcome, StreamingForward, StreamingSearch,
38};
39pub use sink::Sink;