pub struct ConnectorClient { /* private fields */ }Expand description
WebSocket client that communicates with tauri-plugin-connector.
Implementations§
Source§impl ConnectorClient
impl ConnectorClient
pub fn new() -> Self
Sourcepub async fn connect(&mut self, host: &str, port: u16) -> Result<(), String>
pub async fn connect(&mut self, host: &str, port: u16) -> Result<(), String>
Connect to the plugin’s WebSocket server.
Sourcepub fn bind_instance(&self, instance: &str) -> Result<(), String>
pub fn bind_instance(&self, instance: &str) -> Result<(), String>
Pin the application expected by discovery or a previously returned handle. Reconnecting does not clear this binding and cannot silently switch applications.
pub async fn verify_app_identity( &self, auth_token: Option<&str>, ) -> Result<AppIdentity, String>
Sourcepub async fn inspect(
&self,
operation: &str,
arguments: &Value,
) -> Result<Value, String>
pub async fn inspect( &self, operation: &str, arguments: &Value, ) -> Result<Value, String>
Forward to the application-owned inspection service after capability and identity checks. A failed response is never retried and no arbitrary JS fallback exists.
Sourcepub async fn disconnect(&mut self)
pub async fn disconnect(&mut self)
Disconnect from the WebSocket server.
Sourcepub fn is_connected(&self) -> bool
pub fn is_connected(&self) -> bool
Check if connected.
Trait Implementations§
Source§impl Default for ConnectorClient
impl Default for ConnectorClient
Source§impl Drop for ConnectorClient
impl Drop for ConnectorClient
Auto Trait Implementations§
impl !Freeze for ConnectorClient
impl RefUnwindSafe for ConnectorClient
impl Send for ConnectorClient
impl Sync for ConnectorClient
impl Unpin for ConnectorClient
impl UnsafeUnpin for ConnectorClient
impl UnwindSafe for ConnectorClient
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