rsiot/drivers_i2c/pm_rq8/tasks/
output.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
use crate::{
    executor::CmpInOut,
    message::{MsgDataBound, ServiceBound},
};

use super::{I2cResponse, TaskInput};

pub struct Output<TMsg, TService>
where
    TMsg: MsgDataBound,
    TService: ServiceBound,
{
    pub input: TaskInput<I2cResponse>,
    pub output: CmpInOut<TMsg, TService>,
}

impl<TMsg, TService> Output<TMsg, TService>
where
    TMsg: MsgDataBound,
    TService: ServiceBound,
{
    pub async fn spawn(mut self) -> super::Result<()> {
        while let Some(_response) = self.input.recv().await {}
        Err(super::Error::TaskOutput)
    }
}