Remove crate items
This commit is contained in:
11
items_0/src/container.rs
Normal file
11
items_0/src/container.rs
Normal file
@@ -0,0 +1,11 @@
|
||||
use crate::Events;
|
||||
|
||||
pub trait ByteEstimate {
|
||||
fn byte_estimate(&self) -> u64;
|
||||
}
|
||||
|
||||
impl ByteEstimate for Box<dyn Events> {
|
||||
fn byte_estimate(&self) -> u64 {
|
||||
self.as_ref().byte_estimate()
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
pub mod collect_s;
|
||||
pub mod container;
|
||||
pub mod framable;
|
||||
pub mod isodate;
|
||||
pub mod scalar_ops;
|
||||
pub mod streamitem;
|
||||
pub mod subfr;
|
||||
pub mod transform;
|
||||
|
||||
pub mod bincode {
|
||||
pub use bincode::*;
|
||||
@@ -12,6 +12,7 @@ pub mod bincode {
|
||||
|
||||
use collect_s::Collectable;
|
||||
use collect_s::ToJsonResult;
|
||||
use container::ByteEstimate;
|
||||
use netpod::range::evrange::SeriesRange;
|
||||
use netpod::BinnedRangeEnum;
|
||||
use std::any::Any;
|
||||
@@ -135,7 +136,16 @@ impl From<MergeError> for err::Error {
|
||||
|
||||
/// Container of some form of events, for use as trait object.
|
||||
pub trait Events:
|
||||
fmt::Debug + TypeName + Any + Collectable + TimeBinnable + WithLen + Send + erased_serde::Serialize + EventsNonObj
|
||||
fmt::Debug
|
||||
+ TypeName
|
||||
+ Any
|
||||
+ Collectable
|
||||
+ TimeBinnable
|
||||
+ WithLen
|
||||
+ ByteEstimate
|
||||
+ Send
|
||||
+ erased_serde::Serialize
|
||||
+ EventsNonObj
|
||||
{
|
||||
fn as_time_binnable(&self) -> &dyn TimeBinnable;
|
||||
fn verify(&self) -> bool;
|
||||
@@ -183,22 +193,22 @@ pub struct TransformProperties {
|
||||
pub needs_value: bool,
|
||||
}
|
||||
|
||||
pub trait Transformer {
|
||||
pub trait EventTransform {
|
||||
fn query_transform_properties(&self) -> TransformProperties;
|
||||
}
|
||||
|
||||
impl<T> Transformer for Box<T>
|
||||
impl<T> EventTransform for Box<T>
|
||||
where
|
||||
T: Transformer,
|
||||
T: EventTransform,
|
||||
{
|
||||
fn query_transform_properties(&self) -> TransformProperties {
|
||||
self.as_ref().query_transform_properties()
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> Transformer for std::pin::Pin<Box<T>>
|
||||
impl<T> EventTransform for std::pin::Pin<Box<T>>
|
||||
where
|
||||
T: Transformer,
|
||||
T: EventTransform,
|
||||
{
|
||||
fn query_transform_properties(&self) -> TransformProperties {
|
||||
self.as_ref().query_transform_properties()
|
||||
|
||||
@@ -60,7 +60,7 @@ impl AsPrimF32 for String {
|
||||
}
|
||||
|
||||
pub trait ScalarOps:
|
||||
fmt::Debug + Clone + PartialOrd + SubFrId + AsPrimF32 + Serialize + Unpin + Send + 'static
|
||||
fmt::Debug + Clone + PartialOrd + PartialEq + SubFrId + AsPrimF32 + Serialize + Unpin + Send + 'static
|
||||
{
|
||||
fn zero_b() -> Self;
|
||||
fn equal_slack(&self, rhs: &Self) -> bool;
|
||||
|
||||
@@ -142,38 +142,4 @@ mod levelserde {
|
||||
}
|
||||
}
|
||||
|
||||
pub trait ContainsError {
|
||||
fn is_err(&self) -> bool;
|
||||
fn err(&self) -> Option<&::err::Error>;
|
||||
}
|
||||
|
||||
impl<T> ContainsError for Box<T>
|
||||
where
|
||||
T: ContainsError,
|
||||
{
|
||||
fn is_err(&self) -> bool {
|
||||
self.as_ref().is_err()
|
||||
}
|
||||
|
||||
fn err(&self) -> Option<&::err::Error> {
|
||||
self.as_ref().err()
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> ContainsError for Sitemty<T> {
|
||||
fn is_err(&self) -> bool {
|
||||
match self {
|
||||
Ok(_) => false,
|
||||
Err(_) => true,
|
||||
}
|
||||
}
|
||||
|
||||
fn err(&self) -> Option<&::err::Error> {
|
||||
match self {
|
||||
Ok(_) => None,
|
||||
Err(e) => Some(e),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
erased_serde::serialize_trait_object!(TimeBinned);
|
||||
|
||||
Reference in New Issue
Block a user