Skip to main content

PropertyLambda

Struct PropertyLambda 

Source
pub struct PropertyLambda<A: IVm>(/* private fields */);
Expand description

A receiver is live and no region is open: the state after a . node, a.b. Its steps are |() (end_call) and |?.() (option_call); end is the bare node, the read with its receiver dropped — the one property read nanvm-lib has, dot(a, key).end().

No region, so no skipped state: the interior is the step’s own Result, its nullish-receiver throw waiting for a terminal to surface it — a.b(...c) on a nullish a throws at the access with c untouched, which is why end_call takes its arguments as a thunk.

Implementations§

Source§

impl<A: IVm> PropertyLambda<A>

Source

pub fn end(self) -> Result<Any<A>, Any<A>>

No continuation: a.b.

Source

pub fn end_call( self, runtime: &Any<A>, args: impl FnOnce() -> Result<Any<A>, Any<A>>, ) -> Result<Any<A>, Any<A>>

|(), terminal: a.b(...args), the property called on its receiver — an own property, or a built-in member function. No region is open, so this is also what a |!() would be — “there is no bit to clear”.

Source

pub fn end_call_native( self, args: impl FnOnce() -> Result<Any<A>, Any<A>>, ) -> Result<Any<A>, Any<A>>

|() of an intrinsic’s helper, slice(s, a, b): the member call that asks no runtime, the own property else the native else the TypeError, since no body defines the name ([Member::call_native]).

Source

pub fn option_call( self, runtime: &Any<A>, args: impl FnOnce() -> Result<Any<A>, Any<A>>, ) -> OptionLambda<A>

|?.(): a.b?.(...args), opening a region.

Auto Trait Implementations§

§

impl<A> Freeze for PropertyLambda<A>
where A: Freeze,

§

impl<A> RefUnwindSafe for PropertyLambda<A>
where A: RefUnwindSafe,

§

impl<A> Send for PropertyLambda<A>
where A: Send,

§

impl<A> Sync for PropertyLambda<A>
where A: Sync,

§

impl<A> Unpin for PropertyLambda<A>
where A: Unpin,

§

impl<A> UnsafeUnpin for PropertyLambda<A>
where A: UnsafeUnpin,

§

impl<A> UnwindSafe for PropertyLambda<A>
where A: UnwindSafe,

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> 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> ToAny for T

Source§

fn to_any<A: IVm>(self) -> Any<A>
where Self: Into<Unpacked<A>>,

Source§

impl<T> ToArray for T

Source§

fn to_array<A: IVm>(self) -> Array<A>
where Self: Sized + IntoIterator<Item = Any<A>>,

Source§

impl<T> ToObject for T

Source§

fn to_object<A: IVm>(self) -> Object<A>
where Self: Sized + IntoIterator<Item = Property<A>>,

Source§

impl<T> ToString for T

Source§

fn try_to_string<A: IVm>(self) -> Result<String<A>, Any<A>>
where Self: Sized + IntoIterator<Item = Result<u16, Any<A>>>,

Source§

fn to_string<A: IVm>(self) -> String<A>
where Self: Sized + IntoIterator<Item = u16>,

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.