From 1cb0d8e521fdc540ade434eea62f79f64b626e11 Mon Sep 17 00:00:00 2001 From: Lucas Nogueira Date: Wed, 27 Mar 2024 21:36:00 -0300 Subject: [PATCH] doesnt work :( --- core/tauri/src/ipc/command.rs | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/core/tauri/src/ipc/command.rs b/core/tauri/src/ipc/command.rs index 6d479db1e..8af9d35e4 100644 --- a/core/tauri/src/ipc/command.rs +++ b/core/tauri/src/ipc/command.rs @@ -246,7 +246,7 @@ pub mod private { } } - // ===== Result> ===== + // ===== Result> ===== pub struct ResultTag(InvokeResponse); @@ -293,6 +293,28 @@ pub mod private { } } + // ===== Future> ===== + + pub struct BufferFutureTag>>(Pin>); + + pub trait BufferFutureKind>> { + fn async_kind(self) -> BufferFutureTag; + } + + impl>> BufferFutureKind for F { + #[inline(always)] + fn async_kind(self) -> BufferFutureTag { + BufferFutureTag(Box::pin(self)) + } + } + + impl>> BufferFutureTag { + #[inline(always)] + pub fn future(self) -> impl Future> { + self.0.map(|value| Ok(InvokeResponseBody::Raw(value))) + } + } + // ===== Future ===== pub struct FutureTag>(Pin>);