Skip to main content

UserTask

Trait UserTask 

Source
pub trait UserTask {
    // Required method
    async fn run<S, N>(&mut self, net_stack: S, netif: N) -> Result<(), Error>
       where S: NetStack,
             N: NetifDiag + NetChangeNotif;
}
Expand description

A trait representing a user task that needs access to the operational network interface (Netif and net stack) to perform its work.

Note that the task would be started only when rs-matter brings up the operational interface (eth, wifi or thread) and if the interface goes down, the user task would be stopped. Upon re-connection, the task would be started again.

Required Methods§

Source

async fn run<S, N>(&mut self, net_stack: S, netif: N) -> Result<(), Error>

Run the task with the given network stack and network interface

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl UserTask for ()

Source§

fn run<S, N>( &mut self, _net_stack: S, _netif: N, ) -> impl Future<Output = Result<(), Error>>

Source§

impl<T> UserTask for &mut T
where T: UserTask,

Source§

fn run<S, N>( &mut self, net_stack: S, netif: N, ) -> impl Future<Output = Result<(), Error>>

Implementors§