pub struct BootContext<R: Runtime> { /* private fields */ }Expand description
Context passed to the async boot closure.
Provides access to the Tauri AppHandle, state injection into the
Router’s shared state map, and progress event emission.
Implementations§
Source§impl<R: Runtime> BootContext<R>
impl<R: Runtime> BootContext<R>
Sourcepub fn app_handle(&self) -> &AppHandle<R>
pub fn app_handle(&self) -> &AppHandle<R>
Access the Tauri AppHandle.
Sourcepub fn data_dir(&self) -> Result<PathBuf, BootError>
pub fn data_dir(&self) -> Result<PathBuf, BootError>
Convenience: resolve the app data directory.
Sourcepub fn inject_state<S: Send + Sync + 'static>(&self, state: S)
pub fn inject_state<S: Send + Sync + 'static>(&self, state: S)
Inject state into the Router so handlers can access it via
State<Arc<S>>.
State is immediately visible to handlers at call time because the Router resolves state lazily from the shared map.
Sourcepub fn emit_progress(&self, label: &str)
pub fn emit_progress(&self, label: &str)
Emit a progress event to the frontend.
Increments the internal step counter and emits an
allframe-tauri:boot-progress event with the step number, total, and label.
Auto Trait Implementations§
impl<R> !Freeze for BootContext<R>
impl<R> !RefUnwindSafe for BootContext<R>
impl<R> Send for BootContext<R>
impl<R> Sync for BootContext<R>
impl<R> Unpin for BootContext<R>
impl<R> UnsafeUnpin for BootContext<R>
impl<R> !UnwindSafe for BootContext<R>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more