Webbluetooth Async behaviour

This commit is contained in:
Attila Dusnoki 2016-11-08 13:22:33 +01:00
parent 4a7ea72429
commit e7e7c74c9e
19 changed files with 806 additions and 729 deletions

View file

@ -9,6 +9,7 @@
#![deny(unsafe_code)]
extern crate bluetooth_traits;
extern crate cookie as cookie_rs;
extern crate heapsize;
#[macro_use] extern crate heapsize_derive;
@ -32,6 +33,7 @@ extern crate uuid;
extern crate webrender_traits;
extern crate websocket;
use bluetooth_traits::{BluetoothResponseListener, BluetoothResponseResult};
use cookie_rs::Cookie;
use filemanager_thread::FileManagerThreadMsg;
use heapsize::HeapSizeOf;
@ -291,6 +293,13 @@ impl<T: FetchResponseListener> Action<T> for FetchResponseMsg {
}
}
impl<T: BluetoothResponseListener> Action<T> for BluetoothResponseResult {
/// Execute the default action on a provided listener.
fn process(self, listener: &mut T) {
listener.response(self)
}
}
/// A wrapper for a network load that can either be channel or event-based.
#[derive(Deserialize, Serialize)]
pub enum LoadConsumer {