feat: more implementations of StreamMsg

This commit is contained in:
Lucas Colombo 2024-06-04 10:50:16 -03:00
parent 3d9e6800d3
commit 9214306c9f
Signed by: lucas
GPG Key ID: EF34786CFEFFAE35

View File

@ -8,6 +8,11 @@ use {
pub trait StreamMsg: Clone + Send + Sync + 'static {} pub trait StreamMsg: Clone + Send + Sync + 'static {}
impl StreamMsg for String {}
impl StreamMsg for Vec<u8> {}
impl StreamMsg for serde_json::Value {}
impl StreamMsg for serde_json::Map<String, serde_json::Value> {}
// TODO: move this to a separate module, or maybe to the lool library // TODO: move this to a separate module, or maybe to the lool library
pub struct SourceStream<RM: StreamMsg> { pub struct SourceStream<RM: StreamMsg> {
sender: Option<Sender<RM>>, sender: Option<Sender<RM>>,