pub struct PluginBuilder { /* private fields */ }Expand description
Builder for the conduit Tauri v2 plugin.
Collects command registrations and configuration, then produces a
TauriPlugin via build.
Implementations§
Source§impl PluginBuilder
impl PluginBuilder
Sourcepub fn command<F>(self, name: impl Into<String>, handler: F) -> Self
pub fn command<F>(self, name: impl Into<String>, handler: F) -> Self
Register a synchronous command handler.
The handler receives the raw request payload and must return the raw
response payload. Command names correspond to the path segment in the
conduit://localhost/invoke/<cmd_name> URL.
Sourcepub fn channel(self, name: impl Into<String>) -> Self
pub fn channel(self, name: impl Into<String>) -> Self
Register a named ring buffer channel with the default capacity (64 KB).
The JS client can subscribe to push notifications for this channel,
or poll it directly via conduit://localhost/drain/<name>.
Sourcepub fn channel_with_capacity(
self,
name: impl Into<String>,
capacity: usize,
) -> Self
pub fn channel_with_capacity( self, name: impl Into<String>, capacity: usize, ) -> Self
Register a named ring buffer channel with a custom byte capacity.
Sourcepub fn build<R: Runtime>(self) -> TauriPlugin<R>
pub fn build<R: Runtime>(self) -> TauriPlugin<R>
Build the Tauri v2 plugin.
This consumes the builder and returns a TauriPlugin that can be
passed to tauri::Builder::plugin.
Trait Implementations§
Source§impl Debug for PluginBuilder
impl Debug for PluginBuilder
Auto Trait Implementations§
impl Freeze for PluginBuilder
impl !RefUnwindSafe for PluginBuilder
impl Send for PluginBuilder
impl !Sync for PluginBuilder
impl Unpin for PluginBuilder
impl UnsafeUnpin for PluginBuilder
impl !UnwindSafe for PluginBuilder
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