Enum Inner

Source
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>

Source

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.

Source

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.

Source

pub fn map_left_right<D, FL, FR>(self, fl: FL, fr: FR) -> Inner<D, J, X, W>
where FL: FnOnce(C) -> D, FR: FnOnce(C) -> D,

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.

Source

pub fn as_ref(&self) -> Inner<&C, J, &X, &W>

Take references to all contained data.

Source

pub fn disconnect_as_ref(&self) -> Inner<C, J, &X, W>
where J: Copy, C: Copy, W: Copy,

Take references to only the disconnect node.

Source

pub fn map_disconnect<Y, F: FnOnce(X) -> Y>(self, f: F) -> Inner<C, J, Y, W>

Source

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.

Source

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

pub fn map_witness_result<V, E, F: FnOnce(W) -> Result<V, E>>( self, f: F, ) -> Result<Inner<C, J, X, V>, E>

Convert a node’s witness data to a different type.

Source§

impl<C, J, X: Disconnectable<C>, W> Inner<Arc<C>, J, X, W>

Source

pub fn as_dag(&self) -> Dag<&C>

Collapse the node information to a Dag

Source§

impl<C, J, X, W> Inner<Option<C>, J, X, W>

Source

pub fn transpose(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, Option<X>, W>

Source

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>>

Source

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>

Source

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>

Source

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.

Trait Implementations§

Source§

impl<C: Clone, J: Clone, X: Clone, W: Clone> Clone for Inner<C, J, X, W>

Source§

fn clone(&self) -> Inner<C, J, X, W>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<C: Debug, J: Debug, X: Debug, W: Debug> Debug for Inner<C, J, X, W>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<C, J: Display, X, W> Display for Inner<C, J, X, W>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<C: Hash, J: Hash, X: Hash, W: Hash> Hash for Inner<C, J, X, W>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<C: Ord, J: Ord, X: Ord, W: Ord> Ord for Inner<C, J, X, W>

Source§

fn cmp(&self, other: &Inner<C, J, X, W>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<C: PartialEq, J: PartialEq, X: PartialEq, W: PartialEq> PartialEq for Inner<C, J, X, W>

Source§

fn eq(&self, other: &Inner<C, J, X, W>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<C: PartialOrd, J: PartialOrd, X: PartialOrd, W: PartialOrd> PartialOrd for Inner<C, J, X, W>

Source§

fn partial_cmp(&self, other: &Inner<C, J, X, W>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<C: Eq, J: Eq, X: Eq, W: Eq> Eq for Inner<C, J, X, W>

Source§

impl<C, J, X, W> StructuralPartialEq for Inner<C, J, X, W>

Auto Trait Implementations§

§

impl<C, J, X, W> Freeze for Inner<C, J, X, W>
where C: Freeze, X: Freeze, W: Freeze, J: Freeze,

§

impl<C, J, X, W> RefUnwindSafe for Inner<C, J, X, W>

§

impl<C, J, X, W> Send for Inner<C, J, X, W>
where C: Send, X: Send, W: Send, J: Send,

§

impl<C, J, X, W> Sync for Inner<C, J, X, W>
where C: Sync, X: Sync, W: Sync, J: Sync,

§

impl<C, J, X, W> Unpin for Inner<C, J, X, W>
where C: Unpin, X: Unpin, W: Unpin, J: Unpin,

§

impl<C, J, X, W> UnwindSafe for Inner<C, J, X, W>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V