summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2020-08-27 21:49:05 +0200
committerMatthias Beyer <mail@beyermatthias.de>2020-08-27 21:49:19 +0200
commit5ceff05581964a3ba677a0dfde07e314646bb6bd (patch)
tree78bbd813991e2fbfa6466fb1f31e2055998dadcf
parent26eee01831fc38da3598807a0195a78ff29472fe (diff)
Format
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
-rw-r--r--src/client.rs10
-rw-r--r--src/enums.rs95
2 files changed, 51 insertions, 54 deletions
diff --git a/src/client.rs b/src/client.rs
index 7d48676..ddf4145 100644
--- a/src/client.rs
+++ b/src/client.rs
@@ -1,5 +1,3 @@
-
-
use futures::future::poll_fn;
use futures::task::Poll;
use tokio::net::TcpStream;
@@ -16,10 +14,10 @@ type EventClosure = dyn FnMut(&Event) + Sync + Send + 'static;
type EventClosureMutex = Box<EventClosure>;
pub fn event_handler<F>(f: F) -> EventClosureMutex
- where F: FnMut(&Event) + Sync + Send + 'static
- {
- Box::new(f)
- }
+where F: FnMut(&Event) + Sync + Send + 'static
+{
+ Box::new(f)
+}
pub struct FlicClient {
reader: Mutex<OwnedReadHalf>,
diff --git a/src/enums.rs b/src/enums.rs
index 83fe016..b99ea1f 100644
--- a/src/enums.rs
+++ b/src/enums.rs
@@ -1,4 +1,3 @@
-
#![allow(dead_code)]
use num_enum::TryFromPrimitive;
@@ -9,91 +8,91 @@ use num_enum::IntoPrimitive;
#[repr(u8)]
#[derive(Debug, PartialEq, Eq, Hash, Copy, Clone, IntoPrimitive, TryFromPrimitive)]
pub enum CreateConnectionChannelError {
- NoError,
- MaxPendingConnectionsReached,
+ NoError,
+ MaxPendingConnectionsReached,
}
#[repr(u8)]
#[derive(Debug, PartialEq, Eq, Hash, Copy, Clone, IntoPrimitive, TryFromPrimitive)]
pub enum ConnectionStatus {
- Disconnected,
- Connected,
- Ready,
+ Disconnected,
+ Connected,
+ Ready,
}
#[repr(u8)]
#[derive(Debug, PartialEq, Eq, Hash, Copy, Clone, IntoPrimitive, TryFromPrimitive)]
pub enum DisconnectReason {
- Unspecified,
- ConnectionEstablishmentFailed,
- TimedOut,
- BondingKeysMismatch,
+ Unspecified,
+ ConnectionEstablishmentFailed,
+ TimedOut,
+ BondingKeysMismatch,
}
#[repr(u8)]
#[derive(Debug, PartialEq, Eq, Hash, Copy, Clone, IntoPrimitive, TryFromPrimitive)]
pub enum RemovedReason {
- RemovedByThisClient,
- ForceDisconnectedByThisClient,
- ForceDisconnectedByOtherClient,
-
- ButtonIsPrivate,
- VerifyTimeout,
- InternetBackendError,
- InvalidData,
-
- CouldntLoadDevice,
-
- DeletedByThisClient,
- DeletedByOtherClient,
- ButtonBelongsToOtherPartner,
- DeletedFromButton,
+ RemovedByThisClient,
+ ForceDisconnectedByThisClient,
+ ForceDisconnectedByOtherClient,
+
+ ButtonIsPrivate,
+ VerifyTimeout,
+ InternetBackendError,
+ InvalidData,
+
+ CouldntLoadDevice,
+
+ DeletedByThisClient,
+ DeletedByOtherClient,
+ ButtonBelongsToOtherPartner,
+ DeletedFromButton,
}
#[repr(u8)]
#[derive(Debug, PartialEq, Eq, Hash, Copy, Clone, IntoPrimitive, TryFromPrimitive)]
pub enum ClickType {
- ButtonDown,
- ButtonUp,
- ButtonClick,
- ButtonSingleClick,
- ButtonDoubleClick,
- ButtonHold,
+ ButtonDown,
+ ButtonUp,
+ ButtonClick,
+ ButtonSingleClick,
+ ButtonDoubleClick,
+ ButtonHold,
}
#[repr(u8)]
#[derive(Debug, PartialEq, Eq, Hash, Copy, Clone, IntoPrimitive, TryFromPrimitive)]
pub enum BdAddrType {
- PublicBdAddrType,
- RandomBdAddrType,
+ PublicBdAddrType,
+ RandomBdAddrType,
}
#[repr(u8)]
#[derive(Debug, PartialEq, Eq, Hash, Copy, Clone, IntoPrimitive, TryFromPrimitive)]
pub enum LatencyMode {
- NormalLatency,
- LowLatency,
- HighLatency,
+ NormalLatency,
+ LowLatency,
+ HighLatency,
}
#[repr(u8)]
#[derive(Debug, PartialEq, Eq, Hash, Copy, Clone, IntoPrimitive, TryFromPrimitive)]
pub enum ScanWizardResult {
- WizardSuccess,
- WizardCancelledByUser,
- WizardFailedTimeout,
- WizardButtonIsPrivate,
- WizardBluetoothUnavailable,
- WizardInternetBackendError,
- WizardInvalidData,
- WizardButtonBelongsToOtherPartner,
- WizardButtonAlreadyConnectedToOtherDevice,
+ WizardSuccess,
+ WizardCancelledByUser,
+ WizardFailedTimeout,
+ WizardButtonIsPrivate,
+ WizardBluetoothUnavailable,
+ WizardInternetBackendError,
+ WizardInvalidData,
+ WizardButtonBelongsToOtherPartner,
+ WizardButtonAlreadyConnectedToOtherDevice,
}
#[repr(u8)]
#[derive(Debug, PartialEq, Eq, Hash, Copy, Clone, IntoPrimitive, TryFromPrimitive)]
pub enum BluetoothControllerState {
- Detached,
- Resetting,
- Attached,
+ Detached,
+ Resetting,
+ Attached,
}