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
29
30
31
32
33
use crate::impl_::cell_loop::CellLoop as CellLoopImpl;
use crate::Cell;
use crate::SodiumCtx;

pub struct CellLoop<A> {
    impl_: CellLoopImpl<A>,
}

impl<A> Clone for CellLoop<A> {
    fn clone(&self) -> Self {
        CellLoop {
            impl_: self.impl_.clone(),
        }
    }
}

impl<A: Send + Clone + 'static> CellLoop<A> {
    pub fn new(sodium_ctx: &SodiumCtx) -> CellLoop<A> {
        CellLoop {
            impl_: CellLoopImpl::new(&sodium_ctx.impl_),
        }
    }

    pub fn cell(&self) -> Cell<A> {
        Cell {
            impl_: self.impl_.cell(),
        }
    }

    pub fn loop_(&self, ca: &Cell<A>) {
        self.impl_.loop_(&ca.impl_);
    }
}