live-data 0.1.0

Shared descriptor, manifest, and subscription types for the live-feed publisher SDK and the live-stream consumer SDK.
Documentation
//! # live-data
//!
//! Shared descriptor, manifest, and subscription types for the
//! [`live-feed`] publisher SDK and the [`live-stream`] consumer SDK.
//! The crate is transport-agnostic and I/O-free: it defines only the
//! wire-shaped types that both sides of a live data ecosystem agree on.
//!
//! ## Stability
//!
//! Early development, API in flux. The 0.1.0 line locks the *shape* of
//! the wire protocol so the publisher and consumer SDKs can be built
//! against a stable types crate; behavioural and ergonomic improvements
//! land in the runtime crates rather than churning these types.
//!
//! ## Umbrella concepts
//!
//! - [`FeedDescriptor`] - a single named live feed with its schema,
//!   available transports, formats, and server-side capabilities.
//! - [`FeedManifest`] - what a publisher returns when a consumer asks
//!   "what feeds are available here?".
//! - [`SubscriptionDescriptor`] - what a consumer sends when opening a
//!   feed: columns, filter, sampling, preferred transport, and
//!   preferred format.
//! - [`SubscribeResponse`] - the publisher's reply, either an
//!   [`SubscribeAck`] with the endpoint to consume from, or a
//!   [`SubscribeError`] explaining why the request was refused.
//!
//! [`live-feed`]: https://crates.io/crates/live-feed
//! [`live-stream`]: https://crates.io/crates/live-stream

pub mod descriptor;
pub mod endpoint;
pub mod error;
pub mod manifest;
pub mod schema;
pub mod subscription;
pub mod transport;

pub use descriptor::{Capabilities, FeedDescriptor};
pub use endpoint::Endpoint;
pub use error::{Error, Result};
pub use manifest::FeedManifest;
pub use schema::{FieldSpec, WireSchema};
pub use subscription::{
    FilterExpr, Sampling, SubscribeAck, SubscribeError, SubscribeErrorCode, SubscribeResponse,
    SubscriptionDescriptor,
};
pub use transport::{FormatPreference, TransportPreference, TransportTag};

/// Wire protocol version negotiated between publishers and consumers.
///
/// Bumped only when the on-wire shape of any type in this crate changes
/// in a way that older peers cannot tolerate.
pub const PROTOCOL_VERSION: u32 = 1;

/// Control-channel tag used by a consumer to request the manifest.
pub const CONTROL_TAG_FEEDS: &str = "live.feeds";

/// Control-channel tag used by a consumer to open a subscription.
pub const CONTROL_TAG_SUBSCRIBE: &str = "live.subscribe";