nrf-softdevice

Crates

0.1.0

Versions

s112

Flavors

Trait GattValue

Source
pub trait GattValue: Sized {
    const MIN_SIZE: usize;
    const MAX_SIZE: usize;

    // Required methods
    fn from_gatt(data: &[u8]) -> Self;
    fn to_gatt(&self) -> &[u8];
}

Required Associated Constants§

Required Methods§

Source

fn from_gatt(data: &[u8]) -> Self

Source

fn to_gatt(&self) -> &[u8]

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<const N: usize> GattValue for String<N>

Source§

const MIN_SIZE: usize = 0usize

Source§

const MAX_SIZE: usize = N

Source§

fn from_gatt(data: &[u8]) -> Self

Source§

fn to_gatt(&self) -> &[u8]

Source§

impl<const N: usize> GattValue for Vec<u8, N>

Source§

const MIN_SIZE: usize = 0usize

Source§

const MAX_SIZE: usize = N

Source§

fn from_gatt(data: &[u8]) -> Self

Source§

fn to_gatt(&self) -> &[u8]

Source§

impl<const N: usize> GattValue for [u8; N]

Source§

const MIN_SIZE: usize = 0usize

Source§

const MAX_SIZE: usize = N

Source§

fn from_gatt(data: &[u8]) -> Self

Source§

fn to_gatt(&self) -> &[u8]

Implementors§

Source§

impl<T: FixedGattValue> GattValue for T

Source§

const MIN_SIZE: usize = Self::SIZE

Source§

const MAX_SIZE: usize = Self::SIZE