Trait frunk_core::hlist::foldr_owned::HFoldRightableOwned[][src]

pub trait HFoldRightableOwned<Folder, Init>: HFoldRightable<Folder, Init> {
    fn real_foldr(self, folder: Folder, init: Init) -> (Self::Output, Folder);
}
Expand description

A real foldr for the folder that must be owned to fold.

Due to HList being a recursive struct and not linear array, the only way to fold it is recursive.

However, there are differences in the foldl and foldr traversing the HList:

  1. foldl calls folder(head) and then passes the ownership of the folder to the next recursive call.
  2. foldr passes the ownership of the folder to the next recursive call, and then tries to call folder(head); but the ownership is already gone!

Required methods

Implementors