std_modrpc/roles/
byte_stream_receiver.rs1#![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 (
30 Self::Stubs {
31 blob: setup.event_rx(i.blob),
32 },
33 Self::Hooks {},
34 )
35 }
36}
37
38impl Clone for ByteStreamReceiverHooks {
39 fn clone(&self) -> Self {
40 Self {}
41 }
42}