pub trait ToProperty {
type PropertyType;
// Required method
fn to_property(&self) -> Self::PropertyType;
}
Expand description
Convert a type to the correct supported Inspect Property type. This is used in Bluetooth to ensure consistent representations of values in Inspect.
Note: It represents them appropriately for Bluetooth but may not be the appropriate type for other use cases. It shouldn’t be used outside of the Bluetooth project.
Required Associated Types§
type PropertyType
Required Methods§
fn to_property(&self) -> Self::PropertyType
Implementations on Foreign Types§
Source§impl ToProperty for Option<bool>
impl ToProperty for Option<bool>
type PropertyType = u64
fn to_property(&self) -> Self::PropertyType
Source§impl ToProperty for bool
impl ToProperty for bool
type PropertyType = u64
fn to_property(&self) -> Self::PropertyType
Source§impl ToProperty for String
impl ToProperty for String
type PropertyType = String
fn to_property(&self) -> Self::PropertyType
Source§impl<T, V> ToProperty for Option<Vec<T>>where
T: ToProperty<PropertyType = V>,
V: ToString,
impl<T, V> ToProperty for Option<Vec<T>>where
T: ToProperty<PropertyType = V>,
V: ToString,
Vectors of T show up as a comma separated list string property. None
types are
represented as an empty string.