pub struct OptionPropertyLambda<A: IVm>(/* private fields */);Expand description
Both bits live: the state after a ?. node, a?.b, or a |. step
inside a region. Every step is legal here: |() (call), |. (dot),
|?.() (option_call) and |!() (end_call).
Implementations§
Source§impl<A: IVm> OptionPropertyLambda<A>
impl<A: IVm> OptionPropertyLambda<A>
Sourcepub fn end(self) -> Result<Any<A>, Any<A>>
pub fn end(self) -> Result<Any<A>, Any<A>>
No continuation: (a?.b), the region closed with nothing after it.
Sourcepub fn call(
self,
runtime: &Any<A>,
args: impl FnOnce() -> Result<Any<A>, Any<A>>,
) -> OptionLambda<A>
pub fn call( self, runtime: &Any<A>, args: impl FnOnce() -> Result<Any<A>, Any<A>>, ) -> OptionLambda<A>
|(): a?.b(...args), the property called on its receiver, skipped
with the region.
Sourcepub fn dot(
self,
key: impl FnOnce() -> Result<Any<A>, Any<A>>,
) -> OptionPropertyLambda<A>
pub fn dot( self, key: impl FnOnce() -> Result<Any<A>, Any<A>>, ) -> OptionPropertyLambda<A>
|.: a?.b.c, skipped with the region.
Sourcepub fn option_call(
self,
runtime: &Any<A>,
args: impl FnOnce() -> Result<Any<A>, Any<A>>,
) -> OptionLambda<A>
pub fn option_call( self, runtime: &Any<A>, args: impl FnOnce() -> Result<Any<A>, Any<A>>, ) -> OptionLambda<A>
|?.(): a?.b?.(...args), its own guard on the callee.
Sourcepub fn end_call(
self,
runtime: &Any<A>,
args: impl FnOnce() -> Result<Any<A>, Any<A>>,
) -> Result<Any<A>, Any<A>>
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 parentheses close the
region first, so a skipped chain is undefined here and the call
happens regardless — the arguments are evaluated, then undefined
is called and throws. A live chain calls the property on its
receiver; a thrown chain stays thrown, arguments untouched.
Auto Trait Implementations§
impl<A> Freeze for OptionPropertyLambda<A>where
A: Freeze,
impl<A> RefUnwindSafe for OptionPropertyLambda<A>where
A: RefUnwindSafe,
impl<A> Send for OptionPropertyLambda<A>where
A: Send,
impl<A> Sync for OptionPropertyLambda<A>where
A: Sync,
impl<A> Unpin for OptionPropertyLambda<A>where
A: Unpin,
impl<A> UnsafeUnpin for OptionPropertyLambda<A>where
A: UnsafeUnpin,
impl<A> UnwindSafe for OptionPropertyLambda<A>where
A: UnwindSafe,
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