Generic error for body stream

This commit is contained in:
Dominik Werder
2024-11-04 11:05:01 +01:00
parent 3b31c244ee
commit 66538ced79
6 changed files with 27 additions and 16 deletions

View File

@@ -11,7 +11,6 @@ doctest = false
[dependencies]
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
serde_cbor = "0.11.2"
ciborium = "0.2.1"
rmp-serde = "1.1.1"
postcard = { version = "1.0.0", features = ["use-std"] }
@@ -22,8 +21,8 @@ num-traits = "0.2.15"
chrono = { version = "0.4.19", features = ["serde"] }
crc32fast = "1.3.2"
futures-util = "0.3.24"
tokio = { version = "1.20", features = ["rt-multi-thread", "sync", "time"] }
humantime-serde = "1.1.1"
thiserror = "1"
err = { path = "../err" }
items_0 = { path = "../items_0" }
items_proc = { path = "../items_proc" }
@@ -31,3 +30,9 @@ netpod = { path = "../netpod" }
taskrun = { path = "../taskrun" }
parse = { path = "../parse" }
bitshuffle = { path = "../bitshuffle" }
[patch.crates-io]
thiserror = { git = "https://github.com/dominikwerder/thiserror.git", branch = "cstm" }
[features]
heavy = []

View File

@@ -14,6 +14,7 @@ pub mod frame;
pub mod inmem;
pub mod merger;
pub mod streams;
#[cfg(feature = "heavy")]
#[cfg(test)]
pub mod test;
pub mod testgen;
@@ -174,12 +175,3 @@ impl Mergeable for Box<dyn Events> {
pub trait ChannelEventsInput: Stream<Item = Sitemty<ChannelEvents>> + EventTransform + Send {}
impl<T> ChannelEventsInput for T where T: Stream<Item = Sitemty<ChannelEvents>> + EventTransform + Send {}
pub fn runfut<T, F>(fut: F) -> Result<T, err::Error>
where
F: std::future::Future<Output = Result<T, Error>>,
{
use futures_util::TryFutureExt;
let fut = fut.map_err(|e| e.into());
taskrun::run(fut)
}

View File

@@ -31,6 +31,16 @@ use netpod::BinnedRangeEnum;
use std::time::Duration;
use std::time::Instant;
#[cfg(test)]
pub fn runfut<T, F>(fut: F) -> Result<T, err::Error>
where
F: std::future::Future<Output = Result<T, Error>>,
{
use futures_util::TryFutureExt;
let fut = fut.map_err(|e| e.into());
taskrun::run(fut)
}
#[test]
fn items_move_events() {
let evs = make_some_boxed_d0_f32(10, SEC, SEC, 0, 1846713782);