json-ld
json-ld copied to clipboard
Sync versions of `expand` & `compact`?
For a NoLoader
use cases, i.e. "local" data, it would be nice to have sync versions of expand
& compact
. Of course, I am not sure how much trouble this would be, but from the user perspective async versions generally force you to a nasty async architecture of the whole codebase unnecessarily.
I've been thinking about that lately, I think It would be good to have that eventually. I'm concerned about code redundancy. The code base is already large, it would be absurdly large if I had to duplicate it into a sync version. I'd have to also duplicate every change, bug fix etc.
I need a way to write the code once and strip the async definition into a sync one automatically. I don't want to wrap everything inside a regular macro, so I'm looking for a procedural macro here.
I've decided to not solve this issue. Providing a "sync" version of the JSON-LD processing API, in addition to the sync
one, would be too much trouble for me. You can avoid making your whole code async
using any block_on
future implementation if required.