You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#49 added support for mutable references from AnswerFn.
Adding support for .returns should be possible, but some technically backwards-incompatible changes are needed.
Accessing the output value of a return responder is done using a method called get_output(&self). To add mutation support it needs another method like get_output_mut(&mut self) and the eval function also needs its own mutable version (eval_mut(&mut Unimock, ..)) to be able to call the new method.
edit: also consider supporting fragile returns, but not 100% sure. Fragile values are more likely to cause problems when used as returns compared to created in answer fns. For example, a cloned Unimock used from another thread won't work.
The text was updated successfully, but these errors were encountered:
#49 added support for mutable references from
AnswerFn
.Adding support for
.returns
should be possible, but some technically backwards-incompatible changes are needed.Accessing the output value of a return responder is done using a method called
get_output(&self)
. To add mutation support it needs another method likeget_output_mut(&mut self)
and theeval
function also needs its own mutable version (eval_mut(&mut Unimock, ..)
) to be able to call the new method.edit: also consider supporting
fragile
returns, but not 100% sure. Fragile values are more likely to cause problems when used as returns compared to created in answer fns. For example, a cloned Unimock used from another thread won't work.The text was updated successfully, but these errors were encountered: