So I have an async function defined like this:
pub async fn identify(&mut self, nsid: u32, cntid: u16, cns: u8, nvmsetid: u16, uuid: u8) -> Result<IdentifyResponse, queues::Status>
And I'd like to call it but in a non-async context. I know that runtimes have a block_on method but I have absolutely no idea how to implement one myself. I've tried calling it by wrapping it in an
async block but, of course, that won't ever be run, and the compiler complains that it returns a result (I'm guessing the future) that I need to use. But I can't utilize the future in a synchronous context in any way that I know of without using some really weird hackery. So is there an easier way of doing this that doesn't consume ridiculously large amounts of LoC and that doesn't require me to dig in obscure parts of the core library? All my searches have yielded results that just look incredibly messy to use.
I've looked at generators, but I don't think generators will work in this situation.