[][src]Module sunrise_libuser::ipc::server::hrtb_hack

Ideally, that's what we would want to write async fn new_session_wrapper(mut dispatch: F) -> () where F: for<'a> FnMut<(&'a mut u8,)>, for<'a> <F as FnOnce<(&'a mut u8,)>>::Output: Future<Output = Result<(), ()>>, { // Session wrapper code } But the compiler seems to have trouble reasoning about associated types in an HRTB context (maybe that's just not possible ? Not sure).

To work around this, we'll make a supertrait over FnMut<T> and make use of lifetime ellision rules to get this done. So instead, we'll make a wrapper for FnMut that has the right trait bound on its associated output type directly, Implement it for all FnMut with Ret = Output, and use that as a bound instead.

Traits

FutureCallback

A similar trait to FnMut() but moving the Ret associated trait to a generic position, simplifying stuff. See module docs.