#![cfg_attr(docsrs, feature(doc_cfg))]
use p2panda_core::VerifyingKey;
mod dedup;
pub mod manager;
pub mod protocols;
#[doc(hidden)]
#[cfg(any(test, feature = "test_utils"))]
pub mod test_utils;
pub mod traits;
#[derive(Clone, Debug)]
pub struct SessionConfig<T> {
pub topic: T,
pub remote: VerifyingKey,
pub live_mode: bool,
}
#[derive(Clone, Debug)]
pub enum ToSync<M> {
Payload(M),
Close,
}
#[derive(Clone, PartialEq, Debug)]
pub struct FromSync<E> {
pub session_id: u64,
pub remote: VerifyingKey,
pub event: E,
}
impl<E> FromSync<E> {
pub fn session_id(&self) -> u64 {
self.session_id
}
pub fn event(&self) -> &E {
&self.event
}
pub fn remote(&self) -> &VerifyingKey {
&self.remote
}
}