Add String place-holder event type, public facing error message

This commit is contained in:
Dominik Werder
2022-02-15 22:03:56 +01:00
parent a9f9d1ada6
commit 502b8fb6ae
23 changed files with 278 additions and 115 deletions

View File

@@ -5,7 +5,7 @@ use err::Error;
use futures_core::Stream;
use futures_util::StreamExt;
use items::eventsitem::EventsItem;
use items::numops::{BoolNum, NumOps};
use items::numops::{BoolNum, NumOps, StringNum};
use items::plainevents::{PlainEvents, ScalarPlainEvents};
use items::scalarevents::ScalarEvents;
use items::waveevents::{WaveEvents, WaveNBinner, WavePlainProc, WaveXBinner};
@@ -48,6 +48,20 @@ impl NumFromBytes<BoolNum, BigEndian> for BoolNum {
}
}
impl NumFromBytes<StringNum, LittleEndian> for StringNum {
fn convert(_buf: &[u8], _big_endian: bool) -> StringNum {
netpod::log::error!("TODO NumFromBytes for StringNum");
todo!()
}
}
impl NumFromBytes<StringNum, BigEndian> for StringNum {
fn convert(_buf: &[u8], _big_endian: bool) -> StringNum {
netpod::log::error!("TODO NumFromBytes for StringNum");
todo!()
}
}
macro_rules! impl_num_from_bytes_end {
($nty:ident, $nl:expr, $end:ident, $ec:ident) => {
impl NumFromBytes<$nty, $end> for $nty {
@@ -402,6 +416,11 @@ impl EventsItemStream {
let cont = ScalarEvents::<i8>::empty();
ret = Some(EventsItem::Plain(PlainEvents::Scalar(ScalarPlainEvents::I8(cont))));
}
ScalarType::STRING => {
// TODO
let cont = ScalarEvents::<String>::empty();
ret = Some(EventsItem::Plain(PlainEvents::Scalar(ScalarPlainEvents::String(cont))));
}
},
Shape::Wave(_) => todo!(),
Shape::Image(..) => todo!(),
@@ -444,6 +463,7 @@ impl EventsItemStream {
}
}
ScalarType::BOOL => todo!(),
ScalarType::STRING => todo!(),
},
Shape::Wave(_) => todo!(),
Shape::Image(_, _) => todo!(),