-
-
Notifications
You must be signed in to change notification settings - Fork 196
Expand file tree
/
Copy pathplatform.rs
More file actions
44 lines (41 loc) · 1.36 KB
/
platform.rs
File metadata and controls
44 lines (41 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//! The `platform` module contains the platform-specific implementations of the various [`api`]
//! traits. Refer for the `api` module for how to use them.
#[cfg(any(target_os = "linux", target_os = "freebsd"))]
pub use crate::bluez::{
adapter::Adapter, manager::Manager, peripheral::Peripheral, peripheral::PeripheralId,
};
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub use crate::corebluetooth::{
adapter::Adapter, manager::Manager, peripheral::Peripheral, peripheral::PeripheralId,
};
#[cfg(target_os = "android")]
pub use crate::droidplug::{
adapter::Adapter, init, manager::Manager, peripheral::Peripheral, peripheral::PeripheralId,
};
#[cfg(target_os = "windows")]
pub use crate::winrtble::{
adapter::Adapter, manager::Manager, peripheral::Peripheral, peripheral::PeripheralId,
};
use crate::api::{self, Central};
use static_assertions::assert_impl_all;
use std::{
fmt::{Debug, Display},
hash::Hash,
};
// Ensure that the exported types implement all the expected traits.
assert_impl_all!(Adapter: Central, Clone, Debug, Send, Sized, Sync);
assert_impl_all!(Manager: api::Manager, Clone, Debug, Send, Sized, Sync);
assert_impl_all!(Peripheral: api::Peripheral, Clone, Debug, Send, Sized, Sync);
assert_impl_all!(
PeripheralId: Clone,
Debug,
Display,
Hash,
Eq,
Ord,
PartialEq,
PartialOrd,
Send,
Sized,
Sync
);