Skip to main content

asteroid_mq/protocol/node/edge/
packet.rs

1use asteroid_mq_model::EdgeAuth;
2use bytes::Bytes;
3
4#[derive(Debug, Clone, Default)]
5pub struct Auth {
6    pub payload: Bytes,
7}
8
9impl Auth {
10    pub fn new(payload: impl Into<Bytes>) -> Self {
11        Self {
12            payload: payload.into(),
13        }
14    }
15}
16
17impl From<EdgeAuth> for Auth {
18    fn from(value: EdgeAuth) -> Self {
19        Auth {
20            payload: value.payload.0,
21        }
22    }
23}