pub struct Msg {
pub header: Option<Header>,
pub body: Option<Body>,
}
Fields§
§header: Option<Header>
§body: Option<Body>
Implementations§
source§impl<'a> Msg
impl<'a> Msg
Implementation of some extension methods for Msg
s
sourcepub fn msg_id(&'a self) -> &str
pub fn msg_id(&'a self) -> &str
Retrieves the message ID from a Msg structure
§Arguments
self
- A decoded USP Msg structure
§Example
use rusp::usp_decoder::try_decode_msg;
let msg =
try_decode_msg(&[
0x0a, 0x1a, 0x0a, 0x16, 0x41, 0x58, 0x53, 0x53, 0x2d, 0x31, 0x35, 0x34,
0x34, 0x31, 0x31, 0x34, 0x30, 0x34, 0x35, 0x2e, 0x34, 0x34, 0x32, 0x35,
0x39, 0x36, 0x10, 0x02, 0x12, 0x46, 0x12, 0x44, 0x0a, 0x42, 0x0a, 0x40,
0x0a, 0x22, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4c, 0x6f, 0x63,
0x61, 0x6c, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x4d, 0x54, 0x50, 0x2e,
0x31, 0x2e, 0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x2e,
0x15, 0x62, 0x1b, 0x00, 0x00, 0x1a, 0x15, 0x55, 0x6e, 0x73, 0x75, 0x70,
0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x20, 0x70, 0x61, 0x72, 0x61, 0x6d,
0x65, 0x74, 0x65, 0x72
]);
assert_eq!(msg.unwrap().msg_id(), "AXSS-1544114045.442596");
sourcepub const fn is_request(&'a self) -> bool
pub const fn is_request(&'a self) -> bool
Checks whether the body contains a message of type request
§Arguments
self
- A decoded USP Msg structure
§Example
use rusp::usp_decoder::try_decode_msg;
let msg =
try_decode_msg(&[
0x0a, 0x08, 0x0a, 0x04, 0x74, 0x65, 0x73, 0x74,
0x10, 0x03, 0x12, 0x28, 0x0a, 0x26, 0x42, 0x24,
0x0a, 0x05, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x10,
0x01, 0x42, 0x19, 0x0a, 0x06, 0x30, 0x30, 0x34,
0x34, 0x46, 0x46, 0x12, 0x03, 0x46, 0x6f, 0x6f,
0x1a, 0x05, 0x30, 0x31, 0x32, 0x33, 0x34, 0x22,
0x03, 0x31, 0x2e, 0x33,
]).unwrap();
assert_eq!(msg.is_request(), true);
use rusp::usp_decoder::try_decode_msg;
let msg =
try_decode_msg(&[
0x0a, 0x1a, 0x0a, 0x16, 0x41, 0x58, 0x53, 0x53, 0x2d, 0x31, 0x35, 0x34,
0x34, 0x31, 0x31, 0x34, 0x30, 0x34, 0x35, 0x2e, 0x34, 0x34, 0x32, 0x35,
0x39, 0x36, 0x10, 0x02, 0x12, 0x46, 0x12, 0x44, 0x0a, 0x42, 0x0a, 0x40,
0x0a, 0x22, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4c, 0x6f, 0x63,
0x61, 0x6c, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x4d, 0x54, 0x50, 0x2e,
0x31, 0x2e, 0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x2e,
0x15, 0x62, 0x1b, 0x00, 0x00, 0x1a, 0x15, 0x55, 0x6e, 0x73, 0x75, 0x70,
0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x20, 0x70, 0x61, 0x72, 0x61, 0x6d,
0x65, 0x74, 0x65, 0x72
]).unwrap();
assert_eq!(msg.is_request(), false);
sourcepub const fn is_notify_request(&'a self) -> bool
pub const fn is_notify_request(&'a self) -> bool
Checks whether the body contains a message of type notify (request)
§Arguments
self
- A decoded USP Msg structure
§Example
use rusp::usp_decoder::try_decode_msg;
let msg =
try_decode_msg(&[
0x0a, 0x08, 0x0a, 0x04, 0x74, 0x65, 0x73, 0x74,
0x10, 0x03, 0x12, 0x28, 0x0a, 0x26, 0x42, 0x24,
0x0a, 0x05, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x10,
0x01, 0x42, 0x19, 0x0a, 0x06, 0x30, 0x30, 0x34,
0x34, 0x46, 0x46, 0x12, 0x03, 0x46, 0x6f, 0x6f,
0x1a, 0x05, 0x30, 0x31, 0x32, 0x33, 0x34, 0x22,
0x03, 0x31, 0x2e, 0x33,
]).unwrap();
assert_eq!(msg.is_notify_request(), true);
use rusp::usp_decoder::try_decode_msg;
let msg =
try_decode_msg(&[
0x0a, 0x1a, 0x0a, 0x16, 0x41, 0x58, 0x53, 0x53, 0x2d, 0x31, 0x35, 0x34,
0x34, 0x31, 0x31, 0x34, 0x30, 0x34, 0x35, 0x2e, 0x34, 0x34, 0x32, 0x35,
0x39, 0x36, 0x10, 0x02, 0x12, 0x46, 0x12, 0x44, 0x0a, 0x42, 0x0a, 0x40,
0x0a, 0x22, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4c, 0x6f, 0x63,
0x61, 0x6c, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x4d, 0x54, 0x50, 0x2e,
0x31, 0x2e, 0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x2e,
0x15, 0x62, 0x1b, 0x00, 0x00, 0x1a, 0x15, 0x55, 0x6e, 0x73, 0x75, 0x70,
0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x20, 0x70, 0x61, 0x72, 0x61, 0x6d,
0x65, 0x74, 0x65, 0x72
]).unwrap();
assert_eq!(msg.is_notify_request(), false);
sourcepub const fn get_notify_request(&'a self) -> Option<&Notify>
pub const fn get_notify_request(&'a self) -> Option<&Notify>
Retrieves the notify request from the Msg
§Arguments
self
- A decoded USP Msg structure
§Example
use rusp::usp_decoder::try_decode_msg;
let msg =
try_decode_msg(&[
0x0a, 0x08, 0x0a, 0x04, 0x74, 0x65, 0x73, 0x74,
0x10, 0x03, 0x12, 0x28, 0x0a, 0x26, 0x42, 0x24,
0x0a, 0x05, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x10,
0x01, 0x42, 0x19, 0x0a, 0x06, 0x30, 0x30, 0x34,
0x34, 0x46, 0x46, 0x12, 0x03, 0x46, 0x6f, 0x6f,
0x1a, 0x05, 0x30, 0x31, 0x32, 0x33, 0x34, 0x22,
0x03, 0x31, 0x2e, 0x33,
]).unwrap();
assert!(msg.get_notify_request().is_some());
use rusp::usp_decoder::try_decode_msg;
let msg =
try_decode_msg(&[
0x0a, 0x1a, 0x0a, 0x16, 0x41, 0x58, 0x53, 0x53, 0x2d, 0x31, 0x35, 0x34,
0x34, 0x31, 0x31, 0x34, 0x30, 0x34, 0x35, 0x2e, 0x34, 0x34, 0x32, 0x35,
0x39, 0x36, 0x10, 0x02, 0x12, 0x46, 0x12, 0x44, 0x0a, 0x42, 0x0a, 0x40,
0x0a, 0x22, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4c, 0x6f, 0x63,
0x61, 0x6c, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x4d, 0x54, 0x50, 0x2e,
0x31, 0x2e, 0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x2e,
0x15, 0x62, 0x1b, 0x00, 0x00, 0x1a, 0x15, 0x55, 0x6e, 0x73, 0x75, 0x70,
0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x20, 0x70, 0x61, 0x72, 0x61, 0x6d,
0x65, 0x74, 0x65, 0x72
]).unwrap();
assert!(msg.get_notify_request().is_none());
sourcepub const fn is_response(&'a self) -> bool
pub const fn is_response(&'a self) -> bool
Checks whether the body contains a message of type response
§Arguments
self
- A decoded USP Msg structure
§Example
use rusp::usp_decoder::try_decode_msg;
let msg =
try_decode_msg(&[
0x0a, 0x08, 0x0a, 0x04, 0x74, 0x65, 0x73, 0x74,
0x10, 0x03, 0x12, 0x28, 0x0a, 0x26, 0x42, 0x24,
0x0a, 0x05, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x10,
0x01, 0x42, 0x19, 0x0a, 0x06, 0x30, 0x30, 0x34,
0x34, 0x46, 0x46, 0x12, 0x03, 0x46, 0x6f, 0x6f,
0x1a, 0x05, 0x30, 0x31, 0x32, 0x33, 0x34, 0x22,
0x03, 0x31, 0x2e, 0x33,
]).unwrap();
assert_eq!(msg.is_response(), false);
use rusp::usp_decoder::try_decode_msg;
let msg =
try_decode_msg(&[
0x0a, 0x1a, 0x0a, 0x16, 0x41, 0x58, 0x53, 0x53, 0x2d, 0x31, 0x35, 0x34,
0x34, 0x31, 0x31, 0x34, 0x30, 0x34, 0x35, 0x2e, 0x34, 0x34, 0x32, 0x35,
0x39, 0x36, 0x10, 0x02, 0x12, 0x46, 0x12, 0x44, 0x0a, 0x42, 0x0a, 0x40,
0x0a, 0x22, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4c, 0x6f, 0x63,
0x61, 0x6c, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x4d, 0x54, 0x50, 0x2e,
0x31, 0x2e, 0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x2e,
0x15, 0x62, 0x1b, 0x00, 0x00, 0x1a, 0x15, 0x55, 0x6e, 0x73, 0x75, 0x70,
0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x20, 0x70, 0x61, 0x72, 0x61, 0x6d,
0x65, 0x74, 0x65, 0x72
]).unwrap();
assert_eq!(msg.is_response(), true);
sourcepub fn is_error(&'a self) -> bool
pub fn is_error(&'a self) -> bool
Checks whether the body contains a message of type response
§Arguments
self
- A decoded USP Msg structure
§Example
use rusp::usp_decoder::try_decode_msg;
let msg =
try_decode_msg(&[
0x0a, 0x08, 0x0a, 0x04, 0x74, 0x65, 0x73, 0x74,
0x10, 0x03, 0x12, 0x28, 0x0a, 0x26, 0x42, 0x24,
0x0a, 0x05, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x10,
0x01, 0x42, 0x19, 0x0a, 0x06, 0x30, 0x30, 0x34,
0x34, 0x46, 0x46, 0x12, 0x03, 0x46, 0x6f, 0x6f,
0x1a, 0x05, 0x30, 0x31, 0x32, 0x33, 0x34, 0x22,
0x03, 0x31, 0x2e, 0x33,
]).unwrap();
assert_eq!(msg.is_error(), false);
use rusp::usp_decoder::try_decode_msg;
let msg =
try_decode_msg(&[
0x0a, 0x1a, 0x0a, 0x16, 0x41, 0x58, 0x53, 0x53, 0x2d, 0x31, 0x35, 0x34,
0x34, 0x31, 0x31, 0x34, 0x30, 0x34, 0x35, 0x2e, 0x34, 0x34, 0x32, 0x35,
0x39, 0x36, 0x10, 0x02, 0x12, 0x46, 0x12, 0x44, 0x0a, 0x42, 0x0a, 0x40,
0x0a, 0x22, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4c, 0x6f, 0x63,
0x61, 0x6c, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x4d, 0x54, 0x50, 0x2e,
0x31, 0x2e, 0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x2e,
0x15, 0x62, 0x1b, 0x00, 0x00, 0x1a, 0x15, 0x55, 0x6e, 0x73, 0x75, 0x70,
0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x20, 0x70, 0x61, 0x72, 0x61, 0x6d,
0x65, 0x74, 0x65, 0x72
]).unwrap();
assert_eq!(msg.is_error(), false);
use rusp::usp_decoder::try_decode_msg;
let msg =
try_decode_msg(&[
0x0a, 0x05, 0x0a, 0x03, 0x65, 0x72, 0x72, 0x12,
0x17, 0x1a, 0x15, 0x0d, 0x5b, 0x1b, 0x00, 0x00,
0x12, 0x0e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e,
0x61, 0x6c, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72,
]).unwrap();
assert_eq!(msg.is_error(), true);
sourcepub fn get_error(&'a self) -> Option<Error>
pub fn get_error(&'a self) -> Option<Error>
Retrieves the notify request from the Msg
§Arguments
self
- A decoded USP Msg structure
§Example
use rusp::usp_decoder::try_decode_msg;
let msg =
try_decode_msg(&[
0x0a, 0x08, 0x0a, 0x04, 0x74, 0x65, 0x73, 0x74,
0x10, 0x03, 0x12, 0x28, 0x0a, 0x26, 0x42, 0x24,
0x0a, 0x05, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x10,
0x01, 0x42, 0x19, 0x0a, 0x06, 0x30, 0x30, 0x34,
0x34, 0x46, 0x46, 0x12, 0x03, 0x46, 0x6f, 0x6f,
0x1a, 0x05, 0x30, 0x31, 0x32, 0x33, 0x34, 0x22,
0x03, 0x31, 0x2e, 0x33,
]).unwrap();
assert!(msg.get_error().is_none());
use rusp::usp_decoder::try_decode_msg;
let msg =
try_decode_msg(&[
0x0a, 0x1a, 0x0a, 0x16, 0x41, 0x58, 0x53, 0x53, 0x2d, 0x31, 0x35, 0x34,
0x34, 0x31, 0x31, 0x34, 0x30, 0x34, 0x35, 0x2e, 0x34, 0x34, 0x32, 0x35,
0x39, 0x36, 0x10, 0x02, 0x12, 0x46, 0x12, 0x44, 0x0a, 0x42, 0x0a, 0x40,
0x0a, 0x22, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4c, 0x6f, 0x63,
0x61, 0x6c, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x4d, 0x54, 0x50, 0x2e,
0x31, 0x2e, 0x57, 0x65, 0x62, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x2e,
0x15, 0x62, 0x1b, 0x00, 0x00, 0x1a, 0x15, 0x55, 0x6e, 0x73, 0x75, 0x70,
0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x20, 0x70, 0x61, 0x72, 0x61, 0x6d,
0x65, 0x74, 0x65, 0x72
]).unwrap();
assert!(msg.get_error().is_none());
use rusp::usp_decoder::try_decode_msg;
let msg =
try_decode_msg(&[
0x0a, 0x05, 0x0a, 0x03, 0x65, 0x72, 0x72, 0x12,
0x17, 0x1a, 0x15, 0x0d, 0x5b, 0x1b, 0x00, 0x00,
0x12, 0x0e, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e,
0x61, 0x6c, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72,
]).unwrap();
assert!(msg.get_error().is_some());
source§impl Msg
impl Msg
Implementation of some extension methods for Msg
s
sourcepub fn to_json(&self) -> Result<String>
pub fn to_json(&self) -> Result<String>
Encode the Msg as JSON format
§Arguments
self
- A decoded USP Msg structure
§Example
use rusp::usp_decoder::try_decode_msg;
let msg =
try_decode_msg(&[
0x0a, 0x08, 0x0a, 0x04, 0x74, 0x65, 0x73, 0x74,
0x10, 0x03, 0x12, 0x28, 0x0a, 0x26, 0x42, 0x24,
0x0a, 0x05, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x10,
0x01, 0x42, 0x19, 0x0a, 0x06, 0x30, 0x30, 0x34,
0x34, 0x46, 0x46, 0x12, 0x03, 0x46, 0x6f, 0x6f,
0x1a, 0x05, 0x30, 0x31, 0x32, 0x33, 0x34, 0x22,
0x03, 0x31, 0x2e, 0x33,
]).unwrap();
assert_eq!(msg.to_json().unwrap(), "{\"Header\":{\"msg_id\":\"test\",\"msg_type\":\"NOTIFY\"},\"Body\":{\"Request\":{\"Notify\":{\"subscription_id\":\"notif\",\"send_resp\":true,\"on_board_req\":{\"oui\":\"0044FF\",\"product_class\":\"Foo\",\"serial_number\":\"01234\",\"agent_supported_protocol_versions\":\"1.3\"}}}}}");
sourcepub fn to_json_pretty(&self) -> Result<String>
pub fn to_json_pretty(&self) -> Result<String>
Encode the Msg in pretty printed JSON format
§Arguments
self
- A decoded USP Msg structure
§Example
use rusp::usp_decoder::try_decode_msg;
let msg =
try_decode_msg(&[
0x0a, 0x08, 0x0a, 0x04, 0x74, 0x65, 0x73, 0x74,
0x10, 0x03, 0x12, 0x28, 0x0a, 0x26, 0x42, 0x24,
0x0a, 0x05, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x10,
0x01, 0x42, 0x19, 0x0a, 0x06, 0x30, 0x30, 0x34,
0x34, 0x46, 0x46, 0x12, 0x03, 0x46, 0x6f, 0x6f,
0x1a, 0x05, 0x30, 0x31, 0x32, 0x33, 0x34, 0x22,
0x03, 0x31, 0x2e, 0x33,
]).unwrap();
assert_eq!(msg.to_json_pretty().unwrap(), "{\n \"Header\": {\n \"msg_id\": \"test\",\n \"msg_type\": \"NOTIFY\"\n },\n \"Body\": {\n \"Request\": {\n \"Notify\": {\n \"subscription_id\": \"notif\",\n \"send_resp\": true,\n \"on_board_req\": {\n \"oui\": \"0044FF\",\n \"product_class\": \"Foo\",\n \"serial_number\": \"01234\",\n \"agent_supported_protocol_versions\": \"1.3\"\n }\n }\n }\n }\n}");
sourcepub fn to_vec(&self) -> Result<Vec<u8>>
pub fn to_vec(&self) -> Result<Vec<u8>>
Encode the Msg into a Protobuf byte stream returned as Vec<[u8]>
§Arguments
self
- A decoded USP Msg structure
§Example
use rusp::usp_decoder::try_decode_msg;
let bytes = &[
0x0a, 0x08, 0x0a, 0x04, 0x74, 0x65, 0x73, 0x74,
0x10, 0x03, 0x12, 0x28, 0x0a, 0x26, 0x42, 0x24,
0x0a, 0x05, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x10,
0x01, 0x42, 0x19, 0x0a, 0x06, 0x30, 0x30, 0x34,
0x34, 0x46, 0x46, 0x12, 0x03, 0x46, 0x6f, 0x6f,
0x1a, 0x05, 0x30, 0x31, 0x32, 0x33, 0x34, 0x22,
0x03, 0x31, 0x2e, 0x33,
];
let msg = try_decode_msg(bytes).unwrap();
assert_eq!(msg.to_vec().unwrap(), bytes);
sourcepub fn to_c_str(&self) -> Result<String>
pub fn to_c_str(&self) -> Result<String>
Render the Msg
into a raw C string representation
§Arguments
self
- A USPMsg
structure
§Example
use rusp::usp_decoder::try_decode_msg;
let bytes = &[
0x0a, 0x08, 0x0a, 0x04, 0x74, 0x65, 0x73, 0x74,
0x10, 0x03, 0x12, 0x28, 0x0a, 0x26, 0x42, 0x24,
0x0a, 0x05, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x10,
0x01, 0x42, 0x19, 0x0a, 0x06, 0x30, 0x30, 0x34,
0x34, 0x46, 0x46, 0x12, 0x03, 0x46, 0x6f, 0x6f,
0x1a, 0x05, 0x30, 0x31, 0x32, 0x33, 0x34, 0x22,
0x03, 0x31, 0x2e, 0x33,
];
let msg = try_decode_msg(bytes).unwrap();
assert_eq!(msg.to_c_str().unwrap(), "\"\\x0a\\x08\\x0a\\x04test\\x10\\x03\\x12(\\x0a\\x26B\\x24\\x0a\\x05notif\\x10\\x01B\\x19\\x0a\\x060044FF\\x12\\x03Foo\\x1a\\x0501234\\x22\\x031.3\"\n");
sourcepub fn to_c_array(&self) -> Result<String>
pub fn to_c_array(&self) -> Result<String>
Render the Record
into a raw C array representation
§Arguments
self
- A USPRecord
structure
§Example
use rusp::usp_decoder::try_decode_msg;
let bytes = &[
0x0a, 0x08, 0x0a, 0x04, 0x74, 0x65, 0x73, 0x74,
0x10, 0x03, 0x12, 0x28, 0x0a, 0x26, 0x42, 0x24,
0x0a, 0x05, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x10,
0x01, 0x42, 0x19, 0x0a, 0x06, 0x30, 0x30, 0x34,
0x34, 0x46, 0x46, 0x12, 0x03, 0x46, 0x6f, 0x6f,
0x1a, 0x05, 0x30, 0x31, 0x32, 0x33, 0x34, 0x22,
0x03, 0x31, 0x2e, 0x33,
];
let msg = try_decode_msg(bytes).unwrap();
assert_eq!(msg.to_c_array().unwrap(), "unsigned int pb_len = 52;\nconst char pb[] = {\n 0x0a, 0x08, 0x0a, 0x04, 0x74, 0x65, 0x73, 0x74, /* ____test */\n 0x10, 0x03, 0x12, 0x28, 0x0a, 0x26, 0x42, 0x24, /* ___(__B_ */\n 0x0a, 0x05, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x10, /* __notif_ */\n 0x01, 0x42, 0x19, 0x0a, 0x06, 0x30, 0x30, 0x34, /* _B___004 */\n 0x34, 0x46, 0x46, 0x12, 0x03, 0x46, 0x6f, 0x6f, /* 4FF__Foo */\n 0x1a, 0x05, 0x30, 0x31, 0x32, 0x33, 0x34, 0x22, /* __01234\" */\n 0x03, 0x31, 0x2e, 0x33, /* _1.3 */\n};\n");
Trait Implementations§
source§impl<'a> MessageRead<'a> for Msg
impl<'a> MessageRead<'a> for Msg
source§fn from_reader(r: &mut BytesReader, bytes: &'a [u8]) -> Result<Self>
fn from_reader(r: &mut BytesReader, bytes: &'a [u8]) -> Result<Self>
Constructs an instance of
Self
by reading from the given bytes
via the given reader. Read moresource§impl MessageWrite for Msg
impl MessageWrite for Msg
impl StructuralPartialEq for Msg
Auto Trait Implementations§
impl Freeze for Msg
impl RefUnwindSafe for Msg
impl Send for Msg
impl Sync for Msg
impl Unpin for Msg
impl UnwindSafe for Msg
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)