pub enum Inner<C, J, X, W> {
Show 16 variants
Iden,
Unit,
InjL(C),
InjR(C),
Take(C),
Drop(C),
Comp(C, C),
Case(C, C),
AssertL(C, Cmr),
AssertR(Cmr, C),
Pair(C, C),
Disconnect(C, X),
Witness(W),
Fail(FailEntropy),
Jet(J),
Word(Word),
}
Expand description
Internal “Simplicity DAG” structure.
This structure is used to indicate the type of a node and provide pointers or references to its children, if any.
Variants§
Iden
Identity
Unit
Unit constant
InjL(C)
Left injection of some child
InjR(C)
Right injection of some child
Take(C)
Take of some child
Drop(C)
Drop of some child
Comp(C, C)
Composition of a left and right child
Case(C, C)
Case of a left and right child
AssertL(C, Cmr)
Left assertion of a left and right child.
AssertR(Cmr, C)
Right assertion of a left and right child.
Pair(C, C)
Pair of a left and right child
Disconnect(C, X)
Disconnect of a left and right child
Witness(W)
Witness data (missing during commitment, inserted during redemption)
Fail(FailEntropy)
Universal fail
Jet(J)
Application jet
Word(Word)
Constant word
Implementations§
Source§impl<C, J: Clone, X, W> Inner<C, J, X, W>
impl<C, J: Clone, X, W> Inner<C, J, X, W>
Sourcepub fn map<D, F: FnMut(C) -> D>(self, f: F) -> Inner<D, J, X, W>
pub fn map<D, F: FnMut(C) -> D>(self, f: F) -> Inner<D, J, X, W>
Convert a node’s combinator data to a different type.
Sourcepub fn map_result<D, E, F: FnMut(C) -> Result<D, E>>(
self,
f: F,
) -> Result<Inner<D, J, X, W>, E>
pub fn map_result<D, E, F: FnMut(C) -> Result<D, E>>( self, f: F, ) -> Result<Inner<D, J, X, W>, E>
Convert a node’s combinator data to a different type.
Sourcepub fn map_left_right<D, FL, FR>(self, fl: FL, fr: FR) -> Inner<D, J, X, W>
pub fn map_left_right<D, FL, FR>(self, fl: FL, fr: FR) -> Inner<D, J, X, W>
Convert a node’s combinator data to a different type, mapping each child separately.
Importantly, the child of an AssertR
node is considered the left
child, because as a DAG node, this is the sole (left) child, even
though as a combinator, it is a right child.
Sourcepub fn disconnect_as_ref(&self) -> Inner<C, J, &X, W>
pub fn disconnect_as_ref(&self) -> Inner<C, J, &X, W>
Take references to only the disconnect node.
pub fn map_disconnect<Y, F: FnOnce(X) -> Y>(self, f: F) -> Inner<C, J, Y, W>
Sourcepub fn map_disconnect_result<Y, E, F: FnOnce(X) -> Result<Y, E>>(
self,
f: F,
) -> Result<Inner<C, J, Y, W>, E>
pub fn map_disconnect_result<Y, E, F: FnOnce(X) -> Result<Y, E>>( self, f: F, ) -> Result<Inner<C, J, Y, W>, E>
Convert a node’s witness data to a different type.
Sourcepub fn map_witness<V, F: FnOnce(W) -> V>(self, f: F) -> Inner<C, J, X, V>
pub fn map_witness<V, F: FnOnce(W) -> V>(self, f: F) -> Inner<C, J, X, V>
Convert a node’s witness data to a different type.
Source§impl<C, J, X: Disconnectable<C>, W> Inner<Arc<C>, J, X, W>
impl<C, J, X: Disconnectable<C>, W> Inner<Arc<C>, J, X, W>
Source§impl<C, J, X, W> Inner<C, J, Option<X>, W>
impl<C, J, X, W> Inner<C, J, Option<X>, W>
Sourcepub fn transpose_disconnect(self) -> Option<Inner<C, J, X, W>>
pub fn transpose_disconnect(self) -> Option<Inner<C, J, X, W>>
Convert an Inner<Option<C>, J, W>
to an Option<Inner<C, J, W>>
.
Source§impl<C, J, X, W> Inner<C, J, X, Option<W>>
impl<C, J, X, W> Inner<C, J, X, Option<W>>
Sourcepub fn transpose_witness(self) -> Option<Inner<C, J, X, W>>
pub fn transpose_witness(self) -> Option<Inner<C, J, X, W>>
Convert an Inner<C, J, Option<W>>
to an Option<Inner<C, J, W>>
.
Source§impl<C, J: Clone, X, W: Copy> Inner<C, J, X, &W>
impl<C, J: Clone, X, W: Copy> Inner<C, J, X, &W>
Sourcepub fn copy_witness(self) -> Inner<C, J, X, W>
pub fn copy_witness(self) -> Inner<C, J, X, W>
Copies witness data.
Useful in conjunction with Inner::as_ref
when you don’t want to
take a reference to witness data.
Source§impl<C, J: Clone, X: Copy, W> Inner<C, J, &X, W>
impl<C, J: Clone, X: Copy, W> Inner<C, J, &X, W>
Sourcepub fn copy_disconnect(self) -> Inner<C, J, X, W>
pub fn copy_disconnect(self) -> Inner<C, J, X, W>
Copies disconnect data.
Useful in conjunction with Inner::as_ref
when you don’t want to
take a reference to disconnect data.