vidi-core 0.1.0

The core traits and types in for Vidi
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#![allow(clippy::redundant_pub_crate)]

use super::Handler;

pub(crate) type BoxCloneable<Input, Output> = Box<dyn Cloneable<Input, Output = Output>>;

pub(crate) trait Cloneable<Input>: Handler<Input> {
    fn clone_box(&self) -> BoxCloneable<Input, Self::Output>;
}

impl<Input, T> Cloneable<Input> for T
where
    T: Handler<Input> + Clone,
{
    fn clone_box(&self) -> BoxCloneable<Input, Self::Output> {
        Box::new(self.clone())
    }
}