Module error

Source
Expand description

Error types for serial port operations

This module defines the error types used throughout the serial plugin. It provides a unified error handling interface for both desktop and mobile platforms.

§Examples

use tauri_plugin_serialplugin::error::Error;
 
// Example of error handling
fn handle_operation_result(result: Result<(), Error>) {
    match result {
        Ok(_) => println!("Operation successful"),
        Err(Error::Io(msg)) => println!("IO error: {}", msg),
        Err(Error::SerialPort(msg)) => println!("Serial port error: {}", msg),
        Err(Error::String(msg)) => println!("Error: {}", msg),
    }
}

Enums§

Error
An error type for serial port operations