Struct tauri::InvokeResolver
pub struct InvokeResolver<R: Runtime = Wry> { /* fields omitted */ }
Expand description
Resolver of a invoke message.
#
ImplementationsRuntime> InvokeResolver<R>[src]#
impl<R:respond_async<T, F>(self, task: F) where T: Serialize, F: Future<Output = Result<T, InvokeError>> + Send + 'static,[src]#
pub fnReply to the invoke promise with an async task.
respond_async_serialized<F>(self, task: F) where F: Future<Output = Result<JsonValue, InvokeError>> + Send + 'static,[src]#
pub fnReply to the invoke promise with an async task which is already serialized.
respond<T: Serialize>(self, value: Result<T, InvokeError>)[src]#
pub fnReply to the invoke promise with a serializable value.
respond_closure<T, F>(self, f: F) where T: Serialize, F: FnOnce() -> Result<T, InvokeError>,[src]#
pub fnReply to the invoke promise running the given closure.
resolve<T: Serialize>(self, value: T)[src]#
pub fnResolve the invoke promise with a value.
reject<T: Serialize>(self, value: T)[src]#
pub fnReject the invoke promise with a value.
invoke_error(self, error: InvokeError)[src]#
pub fnReject the invoke promise with an InvokeError
.
return_task<T, F>( window: Window<R>, task: F, success_callback: String, error_callback: String ) where T: Serialize, F: Future<Output = Result<T, InvokeError>> + Send + 'static,[src]#
pub async fnAsynchronously executes the given task and evaluates its Result to the JS promise described by the success_callback
and error_callback
function names.
If the Result is_ok()
, the callback will be the success_callback
function name and the argument will be the Ok value. If the Result is_err()
, the callback will be the error_callback
function name and the argument will be the Err value.
#
Trait ImplementationsDebug + Runtime> Debug for InvokeResolver<R>[src]#
impl<R:fmt(&self, f: &mut Formatter<'_>) -> Result[src]#
fnFormats the value using the given formatter. Read more
#
Auto Trait ImplementationsWry> \!RefUnwindSafe for InvokeResolver<R>#
impl<R =Send for InvokeResolver<R>#
impl<R>Sync for InvokeResolver<R> where <R as Runtime>::ClipboardManager: Sync, <R as Runtime>::Dispatcher: Sync, <R as Runtime>::GlobalShortcutManager: Sync, <R as Runtime>::Handle: Sync,#
impl<R>Unpin for InvokeResolver<R> where <R as Runtime>::ClipboardManager: Unpin, <R as Runtime>::Dispatcher: Unpin, <R as Runtime>::GlobalShortcutManager: Unpin, <R as Runtime>::Handle: Unpin,#
impl<R>Wry> \!UnwindSafe for InvokeResolver<R>#
impl<R =#
Blanket ImplementationsAny for T where T: 'static + ?Sized,[src]#
impl<T>type_id(&self) -> TypeId[src]#
pub fnGets the TypeId
of self
. Read more
Borrow<T> for T where T: ?Sized,[src]#
impl<T>borrow(&self) -> &T[src]#
pub fnImmutably borrows from an owned value. Read more
BorrowMut<T> for T where T: ?Sized,[src]#
impl<T>borrow_mut(&mut self) -> &mutT[src]#
pub fnMutably borrows from an owned value. Read more
From<T> for T[src]#
impl<T>from(t: T) -> T[src]#
pub fnPerforms the conversion.
Into<U> for T where U: From<T>,[src]#
impl<T, U>into(self) -> U[src]#
pub fnPerforms the conversion.
TryFrom<U> for T where U: Into<T>,[src]#
impl<T, U>Error = Infallible#
typeThe type returned in the event of a conversion error.
try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]#
pub fnPerforms the conversion.
TryInto<U> for T where U: TryFrom<T>,[src]#
impl<T, U>Error = <U as TryFrom<T>>::Error#
typeThe type returned in the event of a conversion error.
try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]#
pub fnPerforms the conversion.