From 54e10edd52f3ca7bac294d2addf693c7cfde9d31 Mon Sep 17 00:00:00 2001 From: Sebastian Urban Date: Thu, 1 Feb 2024 11:06:05 +0100 Subject: [PATCH] discovery filter: serde support --- bluer/src/adapter.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bluer/src/adapter.rs b/bluer/src/adapter.rs index 01025b2..2352e73 100644 --- a/bluer/src/adapter.rs +++ b/bluer/src/adapter.rs @@ -665,6 +665,7 @@ pub enum AdapterEvent { /// Transport parameter determines the type of scan. #[cfg_attr(docsrs, doc(cfg(feature = "bluetoothd")))] #[derive(Debug, Clone, Copy, Eq, PartialEq, Display, EnumString)] +#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[non_exhaustive] pub enum DiscoveryTransport { /// interleaved scan @@ -690,6 +691,7 @@ impl Default for DiscoveryTransport { /// [duplicate data](Self::duplicate_data). #[cfg_attr(docsrs, doc(cfg(feature = "bluetoothd")))] #[derive(Default, Clone, Debug, Eq, PartialEq)] +#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct DiscoveryFilter { /// Filter by service UUIDs, empty means match /// _any_ UUID. @@ -761,6 +763,7 @@ pub struct DiscoveryFilter { /// string "" pattern will match any device found. pub pattern: Option, #[doc(hidden)] + #[cfg_attr(feature = "serde", serde(skip))] pub _non_exhaustive: (), }