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>
impl<'brand> Arrow<'brand>
Sourcepub fn finalize(&self) -> Result<FinalArrow, Error>
pub fn finalize(&self) -> Result<FinalArrow, Error>
Finalize the source and target types in the arrow
Sourcepub fn shallow_clone(&self) -> Self
pub fn shallow_clone(&self) -> Self
Same as Self::clone
but named to make it clearer that this is cheap
Trait Implementations§
Source§impl<'brand> CoreConstructible<'brand> for Arrow<'brand>
impl<'brand> CoreConstructible<'brand> for Arrow<'brand>
fn iden(inference_context: &Context<'brand>) -> Self
fn unit(inference_context: &Context<'brand>) -> Self
fn injl(child: &Self) -> Self
fn injr(child: &Self) -> Self
fn take(child: &Self) -> Self
fn drop_(child: &Self) -> Self
fn comp(left: &Self, right: &Self) -> Result<Self, Error>
fn case(left: &Self, right: &Self) -> Result<Self, Error>
fn assertl(left: &Self, _: Cmr) -> Result<Self, Error>
fn assertr(_: Cmr, right: &Self) -> Result<Self, Error>
fn pair(left: &Self, right: &Self) -> Result<Self, Error>
fn fail(inference_context: &Context<'brand>, _: FailEntropy) -> Self
fn const_word(inference_context: &Context<'brand>, word: Word) -> Self
Source§fn inference_context(&self) -> &Context<'brand>
fn inference_context(&self) -> &Context<'brand>
Accessor for the type inference context used to create the object.
Source§fn scribe(ctx: &Context<'brand>, value: &Value) -> Self
fn scribe(ctx: &Context<'brand>, value: &Value) -> Self
Create an expression that produces the given
value
. Read moreSource§fn bit_false(inference_context: &Context<'brand>) -> Self
fn bit_false(inference_context: &Context<'brand>) -> Self
Create a DAG that takes any input and returns bit
0
as constant output. Read moreSource§fn bit_true(inference_context: &Context<'brand>) -> Self
fn bit_true(inference_context: &Context<'brand>) -> Self
Create a DAG that takes any input and returns bit
1
as constant output. Read moreSource§fn cond(left: &Self, right: &Self) -> Result<Self, Error>
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 moreSource§fn assert(child: &Self, hash: Cmr) -> Result<Self, Error>
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 moreSource§fn not(child: &Self) -> Result<Self, Error>
fn not(child: &Self) -> Result<Self, Error>
Create a DAG that computes Boolean NOT of the
child
. Read moreSource§impl<'brand> DisconnectConstructible<'brand, Arrow<'brand>> for Arrow<'brand>
impl<'brand> DisconnectConstructible<'brand, Arrow<'brand>> for Arrow<'brand>
fn disconnect(left: &Self, right: &Self) -> Result<Self, Error>
Source§impl<'brand> DisconnectConstructible<'brand, NoDisconnect> for Arrow<'brand>
impl<'brand> DisconnectConstructible<'brand, NoDisconnect> for Arrow<'brand>
fn disconnect(left: &Self, _: &NoDisconnect) -> Result<Self, Error>
Source§impl<'brand, J: Jet> JetConstructible<'brand, J> for Arrow<'brand>
impl<'brand, J: Jet> JetConstructible<'brand, J> for Arrow<'brand>
Auto Trait Implementations§
impl<'brand> Freeze for Arrow<'brand>
impl<'brand> !RefUnwindSafe for Arrow<'brand>
impl<'brand> Send for Arrow<'brand>
impl<'brand> Sync for Arrow<'brand>
impl<'brand> Unpin for Arrow<'brand>
impl<'brand> !UnwindSafe for Arrow<'brand>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more