|
|
@ -842,6 +842,13 @@ impl BrokerRequest { |
|
|
|
BrokerRequest::V0(o) => o.id, |
|
|
|
BrokerRequest::V0(o) => o.id, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
pub fn set_id(&mut self, id: i64) { |
|
|
|
|
|
|
|
match self { |
|
|
|
|
|
|
|
BrokerRequest::V0(v0) => { |
|
|
|
|
|
|
|
v0.id = id; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
pub fn type_id(&self) -> TypeId { |
|
|
|
pub fn type_id(&self) -> TypeId { |
|
|
|
match self { |
|
|
|
match self { |
|
|
|
BrokerRequest::V0(o) => o.content.type_id(), |
|
|
|
BrokerRequest::V0(o) => o.content.type_id(), |
|
|
@ -876,6 +883,13 @@ impl BrokerResponse { |
|
|
|
BrokerResponse::V0(o) => o.id, |
|
|
|
BrokerResponse::V0(o) => o.id, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
pub fn set_id(&mut self, id: i64) { |
|
|
|
|
|
|
|
match self { |
|
|
|
|
|
|
|
BrokerResponse::V0(v0) => { |
|
|
|
|
|
|
|
v0.id = id; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
pub fn result(&self) -> u16 { |
|
|
|
pub fn result(&self) -> u16 { |
|
|
|
match self { |
|
|
|
match self { |
|
|
|
BrokerResponse::V0(o) => o.result, |
|
|
|
BrokerResponse::V0(o) => o.result, |
|
|
@ -1194,6 +1208,13 @@ impl BrokerOverlayRequest { |
|
|
|
BrokerOverlayRequest::V0(o) => o.id, |
|
|
|
BrokerOverlayRequest::V0(o) => o.id, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
pub fn set_id(&mut self, id: i64) { |
|
|
|
|
|
|
|
match self { |
|
|
|
|
|
|
|
BrokerOverlayRequest::V0(v0) => { |
|
|
|
|
|
|
|
v0.id = id; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
pub fn content_v0(&self) -> &BrokerOverlayRequestContentV0 { |
|
|
|
pub fn content_v0(&self) -> &BrokerOverlayRequestContentV0 { |
|
|
|
match self { |
|
|
|
match self { |
|
|
|
BrokerOverlayRequest::V0(o) => &o.content, |
|
|
|
BrokerOverlayRequest::V0(o) => &o.content, |
|
|
@ -1234,6 +1255,13 @@ impl BrokerOverlayResponse { |
|
|
|
BrokerOverlayResponse::V0(o) => o.id, |
|
|
|
BrokerOverlayResponse::V0(o) => o.id, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
pub fn set_id(&mut self, id: i64) { |
|
|
|
|
|
|
|
match self { |
|
|
|
|
|
|
|
BrokerOverlayResponse::V0(v0) => { |
|
|
|
|
|
|
|
v0.id = id; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
pub fn result(&self) -> u16 { |
|
|
|
pub fn result(&self) -> u16 { |
|
|
|
match self { |
|
|
|
match self { |
|
|
|
BrokerOverlayResponse::V0(o) => o.result, |
|
|
|
BrokerOverlayResponse::V0(o) => o.result, |
|
|
@ -1329,6 +1357,17 @@ impl BrokerOverlayMessage { |
|
|
|
}, |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
pub fn set_id(&mut self, id: i64) { |
|
|
|
|
|
|
|
match self { |
|
|
|
|
|
|
|
BrokerOverlayMessage::V0(o) => match &mut o.content { |
|
|
|
|
|
|
|
BrokerOverlayMessageContentV0::BrokerOverlayResponse(ref mut r) => r.set_id(id), |
|
|
|
|
|
|
|
BrokerOverlayMessageContentV0::BrokerOverlayRequest(ref mut r) => r.set_id(id), |
|
|
|
|
|
|
|
BrokerOverlayMessageContentV0::Event(_) => { |
|
|
|
|
|
|
|
panic!("it is an event") |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
pub fn result(&self) -> u16 { |
|
|
|
pub fn result(&self) -> u16 { |
|
|
|
match self { |
|
|
|
match self { |
|
|
|
BrokerOverlayMessage::V0(o) => match &o.content { |
|
|
|
BrokerOverlayMessage::V0(o) => match &o.content { |
|
|
@ -1450,6 +1489,16 @@ impl BrokerMessage { |
|
|
|
BrokerMessage::Close => panic!("Close not implemented"), |
|
|
|
BrokerMessage::Close => panic!("Close not implemented"), |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
pub fn set_id(&mut self, id: i64) { |
|
|
|
|
|
|
|
match self { |
|
|
|
|
|
|
|
BrokerMessage::V0(o) => match &mut o.content { |
|
|
|
|
|
|
|
BrokerMessageContentV0::BrokerOverlayMessage(ref mut p) => p.set_id(id), |
|
|
|
|
|
|
|
BrokerMessageContentV0::BrokerResponse(ref mut r) => r.set_id(id), |
|
|
|
|
|
|
|
BrokerMessageContentV0::BrokerRequest(ref mut r) => r.set_id(id), |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
BrokerMessage::Close => panic!("Close not implemented"), |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
pub fn result(&self) -> u16 { |
|
|
|
pub fn result(&self) -> u16 { |
|
|
|
match self { |
|
|
|
match self { |
|
|
|
BrokerMessage::V0(o) => match &o.content { |
|
|
|
BrokerMessage::V0(o) => match &o.content { |
|
|
@ -1577,6 +1626,13 @@ impl ExtRequest { |
|
|
|
ExtRequest::V0(v0) => v0.id, |
|
|
|
ExtRequest::V0(v0) => v0.id, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
pub fn set_id(&mut self, id: i64) { |
|
|
|
|
|
|
|
match self { |
|
|
|
|
|
|
|
ExtRequest::V0(v0) => { |
|
|
|
|
|
|
|
v0.id = id; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// Content of ExtResponseV0
|
|
|
|
/// Content of ExtResponseV0
|
|
|
@ -1612,6 +1668,13 @@ impl ExtResponse { |
|
|
|
ExtResponse::V0(v0) => v0.id, |
|
|
|
ExtResponse::V0(v0) => v0.id, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
pub fn set_id(&mut self, id: i64) { |
|
|
|
|
|
|
|
match self { |
|
|
|
|
|
|
|
ExtResponse::V0(v0) => { |
|
|
|
|
|
|
|
v0.id = id; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
impl TryFrom<ProtocolMessage> for ExtResponse { |
|
|
|
impl TryFrom<ProtocolMessage> for ExtResponse { |
|
|
@ -1653,6 +1716,18 @@ impl ProtocolMessage { |
|
|
|
ProtocolMessage::BrokerMessage(broker_msg) => broker_msg.id(), |
|
|
|
ProtocolMessage::BrokerMessage(broker_msg) => broker_msg.id(), |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
pub fn set_id(&mut self, id: i64) { |
|
|
|
|
|
|
|
match self { |
|
|
|
|
|
|
|
ProtocolMessage::Noise(_) => panic!("cannot set ID"), |
|
|
|
|
|
|
|
ProtocolMessage::Start(_) => panic!("cannot set ID"), |
|
|
|
|
|
|
|
ProtocolMessage::ServerHello(_) => panic!("cannot set ID"), |
|
|
|
|
|
|
|
ProtocolMessage::ClientAuth(_) => panic!("cannot set ID"), |
|
|
|
|
|
|
|
ProtocolMessage::AuthResult(_) => panic!("cannot set ID"), |
|
|
|
|
|
|
|
ProtocolMessage::ExtRequest(ext_req) => ext_req.set_id(id), |
|
|
|
|
|
|
|
ProtocolMessage::ExtResponse(ext_res) => ext_res.set_id(id), |
|
|
|
|
|
|
|
ProtocolMessage::BrokerMessage(broker_msg) => broker_msg.set_id(id), |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
pub fn type_id(&self) -> TypeId { |
|
|
|
pub fn type_id(&self) -> TypeId { |
|
|
|
match self { |
|
|
|
match self { |
|
|
|
ProtocolMessage::Noise(a) => a.type_id(), |
|
|
|
ProtocolMessage::Noise(a) => a.type_id(), |
|
|
|