std_modrpc/roles/
byte_stream_receiver.rs

1#![allow(unused_variables)]
2
3use crate::interface::ByteStreamInterface;
4use crate::proto::{ByteStreamInitState, ByteStreamReceiverConfig};
5use modrpc::{EventRxBuilder, InterfaceRole, RoleSetup};
6
7pub struct ByteStreamReceiverHooks {}
8
9pub struct ByteStreamReceiverStubs {
10    pub blob: EventRxBuilder<()>,
11}
12
13pub struct ByteStreamReceiverRole {}
14
15impl InterfaceRole for ByteStreamReceiverRole {
16    type Interface = ByteStreamInterface;
17    type Config = ByteStreamReceiverConfig;
18    type Init = ByteStreamInitState;
19    type Stubs = ByteStreamReceiverStubs;
20    type Hooks = ByteStreamReceiverHooks;
21
22    fn setup_worker(
23        i: &Self::Interface,
24        setup: &mut RoleSetup,
25        config: &Self::Config,
26        init: &Self::Init,
27    ) -> (Self::Stubs, Self::Hooks) {
28        (
29            Self::Stubs {
30                blob: setup.event_rx(i.blob),
31            },
32            Self::Hooks {},
33        )
34    }
35}
36
37impl Clone for ByteStreamReceiverHooks {
38    fn clone(&self) -> Self {
39        Self {}
40    }
41}