mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Refactor Bluetooth error handling
This commit is contained in:
parent
d8991496c6
commit
b4db14471b
7 changed files with 76 additions and 62 deletions
|
@ -1,9 +1,19 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use bluetooth_scanfilter::RequestDeviceoptions;
|
||||
use ipc_channel::ipc::IpcSender;
|
||||
|
||||
#[derive(Deserialize, Serialize)]
|
||||
pub enum BluetoothError {
|
||||
Type(String),
|
||||
Network,
|
||||
NotFound,
|
||||
NotSupported,
|
||||
Security,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize)]
|
||||
pub struct BluetoothDeviceMsg {
|
||||
// Bluetooth Device properties
|
||||
|
@ -51,7 +61,7 @@ pub type BluetoothCharacteristicsMsg = Vec<BluetoothCharacteristicMsg>;
|
|||
|
||||
pub type BluetoothDescriptorsMsg = Vec<BluetoothDescriptorMsg>;
|
||||
|
||||
pub type BluetoothResult<T> = Result<T, String>;
|
||||
pub type BluetoothResult<T> = Result<T, BluetoothError>;
|
||||
|
||||
#[derive(Deserialize, Serialize)]
|
||||
pub enum BluetoothMethodMsg {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue