malstrom 0.1.0

Malstrom is a distributed, stateful stream processing framework written in Rust.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! Key types for keyed streams

use std::hash::Hash;

use serde::{Deserialize, Serialize};

/// Marker trait for stream keys
pub trait Key: Hash + Eq + PartialEq + Clone + 'static {}
impl<T: Hash + Eq + PartialEq + Clone + 'static> Key for T {}

/// Marker trait to denote streams that may or may not be keyed
pub trait MaybeKey: Clone + 'static {}
impl<T: Clone + 'static> MaybeKey for T {}

/// Indicates an unkeyed stream
#[derive(Clone, Debug, Hash, PartialEq, Eq, Serialize, Deserialize)]
pub struct NoKey;