#![forbid(unsafe_code)]
#![deny(missing_docs)]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
pub mod clock;
pub mod persistence;
pub mod read_replica_map;
pub mod read_replica_set;
pub mod replicated_map;
pub mod replicated_set;
pub(crate) mod snapshot;
pub use gossip::auth::{ClusterKey, ClusterKeyError};
pub use gossip::{discovery, transport};
pub use lww_register::{bounds, entry};
#[cfg(feature = "metrics-prometheus")]
pub mod prometheus;
pub(crate) mod observability;
pub(crate) mod replica;
pub(crate) mod timeout_wheel;
pub use bounds::{Key, Value};
pub use clock::{Clock, Hlc, LogicalCounter, NodeId, PhysicalTime, Timestamp};
pub use discovery::{DiscoverFuture, Discovery, DiscoveryKind, DnsDiscovery, RandomProbe};
pub use entry::{Entry, State};
pub use transport::{InMemoryNetwork, InMemoryTransport, Transport, UdpTransport};
pub use rsos::{
Aggregate, Fingerprint, FingerprintTreeMap, IntoIter, IntoKeys, IntoValues, ItemRange, Iter,
Keys, Rsos, Values,
};
pub use persistence::{FileSnapshot, InMemoryPersistence, PersistedState, Persistence};
pub use read_replica_map::ReadReplicaMap;
pub use read_replica_set::ReadReplicaSet;
pub use replicated_map::ReplicatedMap;
pub use replicated_set::ReplicatedSet;
#[doc(hidden)]
#[cfg(any(test, feature = "internal-testing"))]
pub mod testing {
pub fn seal_datagram(key: [u8; 32], seq: u64, stamp: u64, payload: &[u8]) -> Vec<u8> {
gossip::auth::Authenticator::new(Some(gossip::auth::ClusterKey::new(key)), false).seal(
gossip::replay::Seq::new(seq),
gossip::replay::Stamp::new(stamp),
payload,
)
}
pub fn members_snapshot<K, V>(
store: &crate::ReplicatedMap<K, V>,
) -> std::collections::HashSet<std::net::IpAddr>
where
K: crate::bounds::Key + std::hash::Hash,
V: crate::bounds::Value,
{
store.members_snapshot()
}
pub fn peers_map_len<K, V>(store: &crate::ReplicatedMap<K, V>) -> usize
where
K: crate::bounds::Key + std::hash::Hash,
V: crate::bounds::Value,
{
store.peers_map_len()
}
pub fn replay_filter_len<K, V>(store: &crate::ReplicatedMap<K, V>) -> usize
where
K: crate::bounds::Key + std::hash::Hash,
V: crate::bounds::Value,
{
store.replay_filter_len()
}
pub fn tombstone_acks_len<K, V>(store: &crate::ReplicatedMap<K, V>) -> usize
where
K: crate::bounds::Key + std::hash::Hash,
V: crate::bounds::Value,
{
store.tombstone_acks_len()
}
pub fn bulk_dumps_in_flight_count<K, V>(store: &crate::ReplicatedMap<K, V>) -> usize
where
K: crate::bounds::Key + std::hash::Hash,
V: crate::bounds::Value,
{
store.bulk_dumps_in_flight_count()
}
}