1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
pub use crate::encoding::internal::autogen::DownstreamFilter;

impl DownstreamFilter {
    pub fn new_no_data_filters<T: ToString>(source_node_id: T) -> Self {
        Self {
            source_node_id: source_node_id.to_string(),
            data_filters: vec![DataFilter::new_no_filter()],
        }
    }
}

pub use crate::encoding::internal::autogen::DataFilter;

impl From<super::DataId> for DataFilter {
    fn from(id: super::DataId) -> Self {
        Self {
            name: id.name,
            type_: id.type_,
        }
    }
}

impl DataFilter {
    pub fn new<T1: ToString, T2: ToString>(name: T1, type_: T2) -> Self {
        Self {
            name: name.to_string(),
            type_: type_.to_string(),
        }
    }

    fn new_no_filter() -> Self {
        Self::new("#", "#")
    }
}