Skip to main content

WithTaba

Struct WithTaba 

Source
pub struct WithTaba<R: Runtime>(/* private fields */);
Expand description

A [tauri::Builder] answering Taba, wrapped to protect the invoke handler.

This overwrites any previous invoke_handler, so all previous commands reject as not found. If you want those commands handled, pass them to WithTaba::with_fallback instead.

Making one takes Tauri’s async runtime, so an app that sets its own with [tauri::async_runtime::set] has to do so first.

Implementations§

Source§

impl<R: Runtime> WithTaba<R>

Source

pub fn new(builder: Builder<R>, router: Router) -> Self

Answers only Taba commands, with router.

Source

pub fn with_fallback<F>( builder: Builder<R>, router: Router, fallback: F, ) -> Self
where F: Fn(Invoke<R>) -> bool + Send + Sync + 'static,

Answers Taba commands with router, otherwise passing through to fallback.

Source

pub fn run(self, context: Context<R>) -> Result<()>

[tauri::Builder::run].

§Errors

The app failed to build or run.

Source

pub fn build(self, context: Context<R>) -> Result<App<R>>

[tauri::Builder::build].

§Errors

The app failed to build.

Trait Implementations§

Source§

impl<R: Runtime> Debug for WithTaba<R>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<R> !Freeze for WithTaba<R>

§

impl<R> !RefUnwindSafe for WithTaba<R>

§

impl<R> Send for WithTaba<R>

§

impl<R> !Sync for WithTaba<R>

§

impl<R> Unpin for WithTaba<R>

§

impl<R> UnsafeUnpin for WithTaba<R>

§

impl<R> !UnwindSafe for WithTaba<R>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> ErasedDestructor for T
where T: 'static,