Struct tauri::InvokeMessage [−][src]
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]
self,
task: F
)
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]
self,
f: F
)
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]
window: Window<M>,
task: F,
success_callback: String,
error_callback: String
)
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,
<<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,
<<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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,