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
I was trying to do a web demo of similar. In particular, of the terminal-inline example.
Problem
The problem I faced is the use of the std::time module, which does not compile to Wasm.
Solutions
One solution is to hide the related functionalities behind a feature.
The one I would prefer is to simply change for an implementation of std::time that works on Wasm, like the instant crate.
It has both Instance and Duration, which all similar uses.
I gave it a try, putting all uses of std::time behind a feature...
But the use of deadline: Option<Instant> is extensively used because
the public API that does not use it fallbacks to use the functions that use deadline with deadline None. So the actual implementation uses deadlines through the code.
the private functions, for example, algorithms\myers\conquer uses deadlines in the logic.
Taking the code as it is and trying to include the feature superficially actually ends up duplicating quite some code.
Hi! Thanks for the crate!
Goal
I was trying to do a web demo of
similar
. In particular, of theterminal-inline
example.Problem
The problem I faced is the use of the
std::time
module, which does not compile to Wasm.Solutions
One solution is to hide the related functionalities behind a feature.
The one I would prefer is to simply change for an implementation of
std::time
that works on Wasm, like theinstant
crate.It has both
Instance
andDuration
, which allsimilar
uses.References
instant
crateThe text was updated successfully, but these errors were encountered: