pub enum MutableTailCall<T, F>where
F: Fn() -> MutableTailCall<T, F>,{
Continue(F),
Done(T),
}Expand description
Represents a tail call that can be either a continuation or a completed result.
Uses static dispatch by parameterizing over the function type F.
Variants§
Continue(F)
A continuation that holds a deferred computation.
Done(T)
A completed computation with a result.
Implementations§
Source§impl<T, F> MutableTailCall<T, F>where
F: Fn() -> MutableTailCall<T, F>,
impl<T, F> MutableTailCall<T, F>where
F: Fn() -> MutableTailCall<T, F>,
Sourcepub fn apply(self) -> MutableTailCall<T, F>
pub fn apply(self) -> MutableTailCall<T, F>
Applies the current step and returns the next TailCall.
§Panics
Panics if called on a completed computation.
Sourcepub fn is_completed(&self) -> bool
pub fn is_completed(&self) -> bool
Checks whether the computation is completed.
Auto Trait Implementations§
impl<T, F> Freeze for MutableTailCall<T, F>
impl<T, F> RefUnwindSafe for MutableTailCall<T, F>where
F: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, F> Send for MutableTailCall<T, F>
impl<T, F> Sync for MutableTailCall<T, F>
impl<T, F> Unpin for MutableTailCall<T, F>
impl<T, F> UnwindSafe for MutableTailCall<T, F>where
F: UnwindSafe,
T: 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