What you're doing is turning the async operation into a synchronous (blocking) one, and so doing this within an async framework is at least as bad as doing synchronous IO. At best, it'll use up one of the async framework's threads, and at worst, using up too many threads could cause the framework to cease to make progress, leading to a complete deadlock. This is why tokio errors here, to prevent this situation.
To fix this, I'd recommend either not calling the sync method from within an async framework, or if you do, using tokio::task::spawn_blocking()
to call it. Then it'll be treated the same as regular, blocking IO and you should be all good.
If your high level application uses the sync method as a primitive, then I think by definition it would also then be a blocking / synchronous IO call, and should thus always be called via spawn_blocking
anyways.