A solution could be to spin up a dedicated thread that holds on to the parse result which is !Send and it listens on a channel whose sender end you put into the typemap instead. Might be overkill though, depending on how expensive the parsing is.
but the crate https://github.com/Geobert/caith could be used in another context where parsing is expensive, that why I tried. But let's be honest, it's very unlikely x) So I won't bother and keep my String and have it parsed again on every action
Ah, okay. Normally I'll try to structure my grammar so you don't need to worry about precedence.
Taking another approach... Why are you implementing half the parsing process in one place and doing the rest (handling precedence) in another place? Can you leverage PrecClimber in the same place as the parser code so you just need to make sure the results are Send and Sync, and it doesn't matter what the intermediate parse values are.
FWIW, there is a very stupid thing to do to "force-Send" non-Send data: spin a thread that holds the data, and interact with it through "messages".
Here is a Playground implementing it (where the closures need to be 'static since, for the sake of simplicity, I have used std's threading API, not crossbeam's, + I have wanted to keep the code unsafe free):
Not very useful nor advisable, and the !Send data needs to be 'static due to non-unsafe type erasure (Any), so definitely not usable for your use case.
But it could be for somebody else interested in the this thread's topic