Struct Arrow

Source
pub struct Arrow {
    pub source: Type,
    pub target: Type,
    pub inference_context: Context,
}
Expand description

A container for an expression’s source and target types, whether or not these types are complete.

Fields§

§source: Type

The source type

§target: Type

The target type

§inference_context: Context

Type inference context for both types.

Implementations§

Source§

impl Arrow

Source

pub fn finalize(&self) -> Result<FinalArrow, Error>

Finalize the source and target types in the arrow

Source

pub fn shallow_clone(&self) -> Self

Same as Self::clone but named to make it clearer that this is cheap

Trait Implementations§

Source§

impl Clone for Arrow

Source§

fn clone(&self) -> Self

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 CoreConstructible for Arrow

Source§

fn iden(inference_context: &Context) -> Self

Source§

fn unit(inference_context: &Context) -> Self

Source§

fn injl(child: &Self) -> Self

Source§

fn injr(child: &Self) -> Self

Source§

fn take(child: &Self) -> Self

Source§

fn drop_(child: &Self) -> Self

Source§

fn comp(left: &Self, right: &Self) -> Result<Self, Error>

Source§

fn case(left: &Self, right: &Self) -> Result<Self, Error>

Source§

fn assertl(left: &Self, _: Cmr) -> Result<Self, Error>

Source§

fn assertr(_: Cmr, right: &Self) -> Result<Self, Error>

Source§

fn pair(left: &Self, right: &Self) -> Result<Self, Error>

Source§

fn fail(inference_context: &Context, _: FailEntropy) -> Self

Source§

fn const_word(inference_context: &Context, word: Word) -> Self

Source§

fn inference_context(&self) -> &Context

Accessor for the type inference context used to create the object.
Source§

fn scribe(ctx: &Context, value: &Value) -> Self

Create an expression that produces the given value. Read more
Source§

fn bit_false(inference_context: &Context) -> Self

Create a DAG that takes any input and returns bit 0 as constant output. Read more
Source§

fn bit_true(inference_context: &Context) -> Self

Create a DAG that takes any input and returns bit 1 as constant output. Read more
Source§

fn cond(left: &Self, right: &Self) -> Result<Self, Error>

Create a DAG that takes a bit and an input, such that the left child is evaluated on the input if the bit is 1 (if branch) and the right child is evaluated on the input otherwise (else branch). Read more
Source§

fn assert(child: &Self, hash: Cmr) -> Result<Self, Error>

Create a DAG that asserts that its child returns true, and fails otherwise. The hash identifies the assertion and is returned upon failure. Read more
Source§

fn not(child: &Self) -> Result<Self, Error>

Create a DAG that computes Boolean NOT of the child. Read more
Source§

fn and(left: &Self, right: &Self) -> Result<Self, Error>

Create a DAG that computes Boolean AND of the left and right child. Read more
Source§

fn or(left: &Self, right: &Self) -> Result<Self, Error>

Create a DAG that computes Boolean OR of the left and right. Read more
Source§

impl Debug for Arrow

Source§

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

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

impl DisconnectConstructible<Arrow> for Arrow

Source§

fn disconnect(left: &Self, right: &Self) -> Result<Self, Error>

Source§

impl DisconnectConstructible<NoDisconnect> for Arrow

Source§

fn disconnect(left: &Self, _: &NoDisconnect) -> Result<Self, Error>

Source§

impl DisconnectConstructible<Option<&Arrow>> for Arrow

Source§

fn disconnect(left: &Self, right: &Option<&Self>) -> Result<Self, Error>

Source§

impl Display for Arrow

Source§

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

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

impl<J: Jet> JetConstructible<J> for Arrow

Source§

fn jet(inference_context: &Context, jet: J) -> Self

Source§

impl<W> WitnessConstructible<W> for Arrow

Source§

fn witness(inference_context: &Context, _: W) -> Self

Auto Trait Implementations§

§

impl Freeze for Arrow

§

impl RefUnwindSafe for Arrow

§

impl Send for Arrow

§

impl Sync for Arrow

§

impl Unpin for Arrow

§

impl UnwindSafe for Arrow

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<J, X, W, T> Constructible<J, X, W> for T

Source§

fn from_inner( inference_context: &Context, inner: Inner<&Self, J, &X, W>, ) -> Result<Self, Error>

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