trouble-host

Crates

git

Versions

default

Flavors

Trait AsGatt

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

    // Required method
    fn as_gatt(&self) -> &[u8];
}
Expand description

Trait to allow conversion of a type to gatt bytes

Required Associated Constants§

Source

const MIN_SIZE: usize

The minimum size the type might be

Source

const MAX_SIZE: usize

The maximum size the type might be

Required Methods§

Source

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

Converts to gatt bytes. Must return a slice of len in MIN_SIZE..=MAX_SIZE

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 AsGatt for &'static str

Source§

const MIN_SIZE: usize = 0usize

Source§

const MAX_SIZE: usize = 4_294_967_295usize

Source§

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

Source§

impl AsGatt for &'static [u8]

Source§

const MIN_SIZE: usize = 0usize

Source§

const MAX_SIZE: usize = 4_294_967_295usize

Source§

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

Source§

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

Source§

const MIN_SIZE: usize = 0usize

Source§

const MAX_SIZE: usize = N

Source§

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

Source§

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

Source§

const MIN_SIZE: usize = 0usize

Source§

const MAX_SIZE: usize = N

Source§

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

Implementors§

Source§

impl AsGatt for Uuid

Source§

const MIN_SIZE: usize = 2usize

Source§

const MAX_SIZE: usize = 16usize

Source§

impl<T: FixedGattValue> AsGatt for T

Source§

const MIN_SIZE: usize = Self::SIZE

Source§

const MAX_SIZE: usize = Self::SIZE

Source§

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

Source§

const MIN_SIZE: usize = 0usize

Source§

const MAX_SIZE: usize = N