'there is no reactor running, must be called from the context of a Tokio 1.x runtime' async api call을 blocking(synchronous call)으로 처리하고 싶다면(제목의 에러가 발생한다면) 아래와 같은 방법을 사용해서 해결을 할 수가 있다. 다만, async->sync call로 바뀌니 app의 동작에 영향을 줄 수 있다는 점도 참고한다. use tokio::runtime::Runtime; fn main() -> Result { // Create the runtime let rt = Runtime::new()?; // Spawn the root task rt.block_on(async { // your async api call here }); } 소스 출처는 https://docs.rs/tokio/1.11.0/tokio/runtime/index.html tokio::.. 이전 1 다음