The DeferredPayload needs to be FnOnce (or FnMut) if we want the user to be able to mutate data within a deferred payload calculation.
This is necessary for things like i.e. minireq, where the user is going to be doing application-level logic within a DeferredPayload calculation, which may necessitate mutation of data and context.
I also implemented ToPayload for &str so you can now call Publication::new("Hello") without having to call as_bytes() on the str.
The
DeferredPayload
needs to beFnOnce
(orFnMut
) if we want the user to be able to mutate data within a deferred payload calculation.This is necessary for things like i.e.
minireq
, where the user is going to be doing application-level logic within aDeferredPayload
calculation, which may necessitate mutation of data and context.I also implemented
ToPayload
for&str
so you can now callPublication::new("Hello")
without having to callas_bytes()
on the str.