Struct sodium_rust::CellLoop
source · pub struct CellLoop<A> { /* private fields */ }
Expand description
A forward reference for a Cell
for creating dependency loops.
Both the creation of a CellLoop
and filling it with the
referenced Cell
by calling loop_
must
occur within the same transaction, whether that is created by
calling SodiumCtx::transaction
or
Transaction::new
.
Implementations§
source§impl<A: Send + Clone + 'static> CellLoop<A>
impl<A: Send + Clone + 'static> CellLoop<A>
sourcepub fn cell(&self) -> Cell<A>
pub fn cell(&self) -> Cell<A>
Return a Cell
that is equivalent to this CellLoop
once it
has been resolved by calling loop_
.
If a Cell
created by CellLoop
may be passed to an
abstraction that uses Cell::sample
, then
Cell::sample_lazy
should be used instead.
sourcepub fn loop_(&self, ca: &Cell<A>)
pub fn loop_(&self, ca: &Cell<A>)
Resolve the loop to specify what this CellLoop
was a forward
reference to.
This function must be invoked in the same transaction as the
place where the CellLoop
was created. This requires creating
an explicit transaction, either with
SodiumCtx::transaction
or
Transaction::new
.