It compiles

This commit is contained in:
Dominik Werder
2021-05-20 20:04:21 +02:00
parent 49af7ce561
commit 30be7d1c44
25 changed files with 424 additions and 663 deletions

View File

@@ -1,3 +1,4 @@
use crate::agg::streams::StreamItem;
use crate::frame::makeframe::{INMEM_FRAME_FOOT, INMEM_FRAME_HEAD, INMEM_FRAME_MAGIC};
use bytes::{BufMut, Bytes, BytesMut};
use err::Error;
@@ -241,7 +242,7 @@ impl<T> Stream for InMemoryFrameAsyncReadStream<T>
where
T: AsyncRead + Unpin,
{
type Item = Result<InMemoryFrame, Error>;
type Item = Result<StreamItem<InMemoryFrame>, Error>;
fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context) -> Poll<Option<Self::Item>> {
use Poll::*;
@@ -270,7 +271,7 @@ where
self.completed = true;
Ready(None)
}
Some(Some(Ok(k))) => Ready(Some(Ok(k))),
Some(Some(Ok(item))) => Ready(Some(Ok(StreamItem::DataItem(item)))),
Some(Some(Err(e))) => {
self.tryparse = false;
self.errored = true;

View File

@@ -25,10 +25,6 @@ impl FrameType for RawConnOut {
const FRAME_TYPE_ID: u32 = 0x04;
}
impl FrameType for Result<PreBinnedItem, Error> {
const FRAME_TYPE_ID: u32 = 0x05;
}
impl FrameType for Result<StreamItem<BinnedScalarStreamItem>, Error> {
const FRAME_TYPE_ID: u32 = 0x06;
}
@@ -37,6 +33,10 @@ impl FrameType for Result<MinMaxAvgScalarBinBatchStreamItem, Error> {
const FRAME_TYPE_ID: u32 = 0x07;
}
impl FrameType for Result<StreamItem<PreBinnedItem>, Error> {
const FRAME_TYPE_ID: u32 = 0x08;
}
pub fn make_frame<FT>(item: &FT) -> Result<BytesMut, Error>
where
FT: FrameType + Serialize,