sodium_rust/operational.rs
1use crate::Cell;
2use crate::Stream;
3
4/// Operational primitives that must be used with care because they
5/// break non-detectability of `Cell` steps/updates.
6pub struct Operational {}
7
8impl Operational {
9 pub fn updates<A: Clone + Send + 'static>(ca: &Cell<A>) -> Stream<A> {
10 Stream {
11 impl_: ca.impl_.updates(),
12 }
13 }
14
15 pub fn value<A: Clone + Send + 'static>(ca: &Cell<A>) -> Stream<A> {
16 Stream {
17 impl_: ca.impl_.value(),
18 }
19 }
20
21 pub fn defer<A: Clone + Send + 'static>(sa: &Stream<A>) -> Stream<A> {
22 Stream {
23 impl_: sa.impl_.defer(),
24 }
25 }
26}