Struct sodium_rust::SodiumCtx
source · pub struct SodiumCtx {
pub impl_: SodiumCtxImpl,
}
Expand description
A context object representing a specific instance of a Sodium system.
Fields§
§impl_: SodiumCtxImpl
Implementations§
source§impl SodiumCtx
impl SodiumCtx
sourcepub fn new_cell<A: Clone + Send + 'static>(&self, a: A) -> Cell<A>
pub fn new_cell<A: Clone + Send + 'static>(&self, a: A) -> Cell<A>
Create a new constant value Cell
in this context.
sourcepub fn new_stream<A: Clone + Send + 'static>(&self) -> Stream<A>
pub fn new_stream<A: Clone + Send + 'static>(&self) -> Stream<A>
Create a new stream that will never fire in this context.
sourcepub fn new_cell_sink<A: Clone + Send + 'static>(&self, a: A) -> CellSink<A>
pub fn new_cell_sink<A: Clone + Send + 'static>(&self, a: A) -> CellSink<A>
Create a new CellSink
for interfacing I/O and FRP.
sourcepub fn new_stream_sink<A: Clone + Send + 'static>(&self) -> StreamSink<A>
pub fn new_stream_sink<A: Clone + Send + 'static>(&self) -> StreamSink<A>
Create a new StreamSink
for interfacing I/O and FRP.
sourcepub fn new_cell_loop<A: Clone + Send + 'static>(&self) -> CellLoop<A>
pub fn new_cell_loop<A: Clone + Send + 'static>(&self) -> CellLoop<A>
sourcepub fn new_stream_loop<A: Clone + Send + 'static>(&self) -> StreamLoop<A>
pub fn new_stream_loop<A: Clone + Send + 'static>(&self) -> StreamLoop<A>
Create a new StreamLoop
to act as a forward reference for
a Stream
that will be created later.
sourcepub fn new_stream_sink_with_coalescer<A: Clone + Send + 'static, COALESCER: FnMut(&A, &A) -> A + Send + 'static>(
&self,
coalescer: COALESCER
) -> StreamSink<A>
pub fn new_stream_sink_with_coalescer<A: Clone + Send + 'static, COALESCER: FnMut(&A, &A) -> A + Send + 'static>(
&self,
coalescer: COALESCER
) -> StreamSink<A>
Create a new StreamSink
with a combining function that
allows send
ing multiple event values per
transaction.
sourcepub fn transaction<R, K: FnOnce() -> R>(&self, k: K) -> R
pub fn transaction<R, K: FnOnce() -> R>(&self, k: K) -> R
Run the given function inside a single Sodium transaction, closing the transaction after the function returns.
sourcepub fn new_transaction(&self) -> Transaction
pub fn new_transaction(&self) -> Transaction
Create a new scoped transaction object.
The Sodium transaction on this context will be held open until
the returned Transaction
is dropped or
Transaction::close is called explicitly.