net_core_api/api/primitives/
none.rs1use crate::core::api::API;
2use crate::core::decoder_api::Decoder;
3use crate::core::encoder_api::Encoder;
4use crate::core::typed_api::Typed;
5
6const DATA_TYPE: &str = "none";
7
8#[derive(Default, Debug, PartialEq, Eq, Clone)]
9pub struct None {}
10
11impl API for None {}
12
13impl Typed for None {
14 fn get_type(&self) -> &str {
15 DATA_TYPE
16 }
17
18 fn get_data_type() -> &'static str where Self : Sized {
19 DATA_TYPE
20 }
21}
22
23impl Encoder for None {
24 fn encode(&self) -> Vec<u8> {
25 vec![]
26 }
27}
28
29impl Decoder for None {
30 fn decode(_data: &[u8]) -> Self {
31 Self::default()
32 }
33}