1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#[derive(Default)]
pub struct ReconstructorContext {}

impl ReconstructorContext {
    pub fn new() -> Self {
        ReconstructorContext {}
    }
}

pub trait ReconstructableFrom<T> {
    fn reconstruct_from(from: T, builder: &ReconstructorContext) -> Self;
}

impl<T> ReconstructableFrom<T> for T {
    fn reconstruct_from(from: T, _builder: &ReconstructorContext) -> Self {
        from
    }
}

impl<T: Clone> ReconstructableFrom<&T> for T {
    fn reconstruct_from(from: &T, _builder: &ReconstructorContext) -> Self {
        from.clone()
    }
}

pub trait IntoRaw<R> {
    fn into_raw(self) -> R;
}