These traits are only implemented for Lambda<FN> and anything that implements FnMut of the various arities.
First of all, to nudge users in the direction of maintaining functional purity, the bound should probably be Fn not FnMut.
I believe the purpose is to allow using either a FnMut with no dependency information, or a Lambda that contains a function and also has dependency information.
It's not clear to me that this is actually serving a useful purpose, are Lambdas actually supposed to be constructed by the user? Does internal code pass Lambdas to the public API functions that take IsLambda?
These traits are only implemented for
Lambda<FN>
and anything that implementsFnMut
of the various arities.First of all, to nudge users in the direction of maintaining functional purity, the bound should probably be
Fn
notFnMut
.I believe the purpose is to allow using either a
FnMut
with no dependency information, or aLambda
that contains a function and also has dependency information.It's not clear to me that this is actually serving a useful purpose, are
Lambda
s actually supposed to be constructed by the user? Does internal code passLambda
s to the public API functions that takeIsLambda
?