#![forbid(unsafe_code)]
#![deny(
clippy::unwrap_used,
clippy::expect_used,
clippy::cast_possible_truncation,
clippy::cast_sign_loss
)]
#![warn(
unused,
clippy::cognitive_complexity,
unused_crate_dependencies,
unused_extern_crates,
clippy::unused_self,
clippy::useless_let_if_seq,
missing_debug_implementations,
rust_2018_idioms
)]
#![allow(clippy::type_complexity, clippy::too_many_arguments, type_alias_bounds)]
#[cfg(test)]
use sha2 as _;
use ::serde::{Deserialize, Serialize};
#[cfg(feature = "error")]
pub mod error;
#[cfg(feature = "protocol")]
pub mod protocol;
#[cfg(feature = "metric")]
pub mod metric;
#[cfg(feature = "subscription")]
pub mod subscription;
#[cfg(feature = "channel")]
pub mod channel;
#[cfg(feature = "collection")]
pub mod collection;
#[cfg(feature = "serde")]
pub mod serde;
#[cfg(feature = "stream")]
pub mod stream;
#[cfg(feature = "socket")]
pub mod socket;
pub trait Validator {
type Error;
fn validate(self) -> Result<Self, Self::Error>
where
Self: Sized;
}
pub trait Transformer {
type Error;
type Input;
type Output;
type OutputIter: IntoIterator<Item = Result<Self::Output, Self::Error>>;
fn transform(&mut self, input: Self::Input) -> Self::OutputIter;
}
pub trait Unrecoverable {
fn is_unrecoverable(&self) -> bool;
}
pub trait Terminal {
fn is_terminal(&self) -> bool;
}
#[derive(
Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Default, Deserialize, Serialize,
)]
pub struct FeedEnded;
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Deserialize, Serialize)]
pub enum Message<A, T> {
Admin(A),
Payload(T),
}
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Deserialize, Serialize)]
pub enum Admin<P, A> {
Protocol(P),
Application(A),
}