Struct tauri::InvokeMessage[][src]

pub struct InvokeMessage<M: Params> { /* fields omitted */ }

An invoke message.

Implementations

impl<M: Params> InvokeMessage<M>[src]

pub fn command(&self) -> &str[src]

The invoke command.

pub fn payload(&self) -> Value[src]

The invoke payload.

pub fn window(&self) -> Window<M>[src]

The window that received the invoke.

pub fn respond_async<T: Serialize, Err: Serialize, F: Future<Output = Result<T, Err>> + Send + 'static>(
    self,
    task: F
)
[src]

Reply to the invoke promise with an async task.

pub fn respond_closure<T: Serialize, Err: Serialize, F: FnOnce() -> Result<T, Err>>(
    self,
    f: F
)
[src]

Reply to the invoke promise running the given closure.

pub fn resolve<S: Serialize>(self, value: S)[src]

Resolve the invoke promise with a value.

pub fn reject<S: Serialize>(self, value: S)[src]

Reject the invoke promise with a value.

pub async fn return_task<T: Serialize, Err: Serialize, F: Future<Output = Result<T, Err>> + Send + 'static>(
    window: Window<M>,
    task: F,
    success_callback: String,
    error_callback: String
)
[src]

Asynchronously 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.

Auto Trait Implementations

impl<M> !RefUnwindSafe for InvokeMessage<M>

impl<M> Send for InvokeMessage<M>

impl<M> Sync for InvokeMessage<M> where
    <<M as Params>::Runtime as Runtime>::Dispatcher: Sync

impl<M> Unpin for InvokeMessage<M> where
    <<M as Params>::Runtime as Runtime>::Dispatcher: Unpin,
    <M as Params>::Label: Unpin

impl<M> !UnwindSafe for InvokeMessage<M>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,