ctaphid_dispatch/
types.rs1use ctaphid_app::{Command, Error};
2use heapless_bytes::Bytes;
3
4pub const MESSAGE_SIZE: usize = 7609;
5
6pub type Message = Bytes<MESSAGE_SIZE>;
7
8pub struct InterchangeResponse(pub Result<Message, Error>);
10
11impl Default for InterchangeResponse {
12 fn default() -> Self {
13 InterchangeResponse(Ok(Message::new()))
14 }
15}
16
17impl From<Result<Message, Error>> for InterchangeResponse {
18 fn from(value: Result<Message, Error>) -> Self {
19 Self(value)
20 }
21}
22
23impl From<InterchangeResponse> for Result<Message, Error> {
24 fn from(value: InterchangeResponse) -> Self {
25 value.0
26 }
27}
28
29pub type Responder<'pipe> = interchange::Responder<'pipe, (Command, Message), InterchangeResponse>;
30pub type Requester<'pipe> = interchange::Requester<'pipe, (Command, Message), InterchangeResponse>;
31pub type Channel = interchange::Channel<(Command, Message), InterchangeResponse>;