Skip to main content

Arrow

Struct Arrow 

Source
pub struct Arrow<'brand> {
    pub source: Type<'brand>,
    pub target: Type<'brand>,
    pub inference_context: Context<'brand>,
}
Expand description

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

Fields§

§source: Type<'brand>

The source type

§target: Type<'brand>

The target type

§inference_context: Context<'brand>

Type inference context for both types.

Implementations§

Source§

impl<'brand> Arrow<'brand>

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

Source

pub fn hidden(inference_context: &Context<'brand>) -> Self

A type arrow where both source and target types are new free variables.

This should be used for hidden nodes or other nodes where nothing about the node is known.

Source

pub fn program(inference_context: &Context<'brand>) -> Self

A type arrow where both source and target types fixed to the unit type.

Source

pub fn iden(inference_context: &Context<'brand>) -> Self

Source

pub fn unit(inference_context: &Context<'brand>) -> Self

Source

pub fn injl(child: &Self) -> Self

Source

pub fn injr(child: &Self) -> Self

Source

pub fn take(child: &Self) -> Self

Source

pub fn drop_(child: &Self) -> Self

Source

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

Source

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

Source

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

Source

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

Source

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

Source

pub fn fail(inference_context: &Context<'brand>) -> Self

Source

pub fn const_word(inference_context: &Context<'brand>, word: &Word) -> Self

Source

pub fn jet(inference_context: &Context<'brand>, jet: &dyn Jet) -> Self

Source

pub fn witness(inference_context: &Context<'brand>) -> Self

Source

pub fn inference_context(&self) -> &Context<'brand>

Trait Implementations§

Source§

impl Clone for Arrow<'_>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<'brand> Debug for Arrow<'brand>

Source§

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

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

impl<'brand> DisconnectConstructible<'brand, Arrow<'brand>> for Arrow<'brand>

Source§

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

Source§

impl<'brand> DisconnectConstructible<'brand, NoDisconnect> for Arrow<'brand>

Source§

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

Source§

impl<'brand> DisconnectConstructible<'brand, Option<&Arrow<'brand>>> for Arrow<'brand>

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

Auto Trait Implementations§

§

impl<'brand> !RefUnwindSafe for Arrow<'brand>

§

impl<'brand> !UnwindSafe for Arrow<'brand>

§

impl<'brand> Freeze for Arrow<'brand>

§

impl<'brand> Send for Arrow<'brand>

§

impl<'brand> Sync for Arrow<'brand>

§

impl<'brand> Unpin for Arrow<'brand>

§

impl<'brand> UnsafeUnpin for Arrow<'brand>

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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

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

fn try_from(value: U) -> Result<T, !>

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