Add test binned json

This commit is contained in:
Dominik Werder
2023-04-14 15:50:10 +02:00
parent 6500310cf3
commit f20beafd96
13 changed files with 169 additions and 68 deletions

View File

@@ -49,7 +49,7 @@ impl ToJsonBytes for serde_json::Value {
}
}
pub trait Collected: fmt::Debug + ToJsonResult + AsAnyRef + Send {}
pub trait Collected: fmt::Debug + Send + AsAnyRef + WithLen + ToJsonResult {}
erased_serde::serialize_trait_object!(Collected);
@@ -59,6 +59,12 @@ impl ToJsonResult for Box<dyn Collected> {
}
}
impl WithLen for Box<dyn Collected> {
fn len(&self) -> usize {
self.as_ref().len()
}
}
impl Collected for Box<dyn Collected> {}
// TODO rename to `Typed`