tailrec

Trait TailRec

Source
pub trait TailRec<Output, F> {
    // Provided methods
    fn rec(self, iterate: F) -> Output
       where Self: Sized,
             F: Fn(Self) -> Result<Output, Self> { ... }
    fn rec_ref<'a>(&'a self, iterate: F) -> Output
       where F: for<'r> Fn(&'r Self) -> Result<Output, &'r Self> { ... }
    fn rec_mut(self, iterate: F) -> Output
       where Self: Sized,
             F: FnMut(Self) -> Result<Output, Self> { ... }
    fn rec_ref_mut<'a>(&'a mut self, iterate: F) -> Output
       where F: for<'r> FnMut(&'r mut Self) -> Result<Output, &'r mut Self> { ... }
}

Provided Methods§

Source

fn rec(self, iterate: F) -> Output
where Self: Sized, F: Fn(Self) -> Result<Output, Self>,

Source

fn rec_ref<'a>(&'a self, iterate: F) -> Output
where F: for<'r> Fn(&'r Self) -> Result<Output, &'r Self>,

Source

fn rec_mut(self, iterate: F) -> Output
where Self: Sized, F: FnMut(Self) -> Result<Output, Self>,

Source

fn rec_ref_mut<'a>(&'a mut self, iterate: F) -> Output
where F: for<'r> FnMut(&'r mut Self) -> Result<Output, &'r mut Self>,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<Output, F, State> TailRec<Output, F> for State