Skip to main content

Network

Trait Network 

Source
pub trait Network: Sealed {
    type Embedding<'a>: Embedding
       where Self: 'a;
    type Networks: RsNetworks;

    const INIT: Self;
    const NETWORKS: Self::Networks;

    // Required methods
    fn init() -> impl Init<Self>;
    fn init_networks() -> impl Init<Self::Networks>;
    fn discovery_capabilities(&self) -> DiscoveryCapabilities;
    fn embedding(&self) -> &Self::Embedding<'_>;
}
Expand description

A trait modeling a specific network type. MatterStack is parameterized by a network type implementing this trait.

The trait is sealed and has only two implementations: Eth and WirelessBle.

Required Associated Constants§

Source

const INIT: Self

Source

const NETWORKS: Self::Networks

A const initializer for the rs-matter networks store (used by the const MatterStack::new constructor).

Required Associated Types§

Source

type Embedding<'a>: Embedding where Self: 'a

Optional additional state embedded in the network state

Source

type Networks: RsNetworks

The rs-matter networks store type owned by the stack’s InteractionModelState for this network kind.

For Ethernet (and other transports where the Matter stack does not manage network credentials) this is a no-op store; for the wireless (BLE+Wifi/Thread) network it is a WirelessNetworks store.

Required Methods§

Source

fn init() -> impl Init<Self>

Return an in-place initializer for the network type.

Source

fn init_networks() -> impl Init<Self::Networks>

Return an in-place initializer for the rs-matter networks store.

Source

fn discovery_capabilities(&self) -> DiscoveryCapabilities

Return the discovery capabilities of this network when commissioning the device.

Source

fn embedding(&self) -> &Self::Embedding<'_>

Return a reference to the embedded user data.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<E> Network for Eth<E>
where E: Embedding,

Source§

const INIT: Self

Source§

const NETWORKS: Self::Networks = DummyNetworks

Source§

type Embedding<'a> = E where E: 'a

Source§

type Networks = DummyNetworks

Source§

impl<T, E> Network for WirelessBle<T, E>

Source§

const INIT: Self

Source§

const NETWORKS: Self::Networks

Source§

type Embedding<'a> = E where Self: 'a

Source§

type Networks = WirelessNetworks<MAX_WIRELESS_NETWORKS, T>