Function new_msg_req

Source
pub fn new_msg_req(bytes: Vec<u8>, _format: &TlpFmt) -> Box<dyn MessageRequest>
Expand description

Obtain Message Request dyn Trait:

ยงExamples

use rtlp_lib::TlpFmt;
use rtlp_lib::MessageRequest;
use rtlp_lib::new_msg_req;

let bytes = vec![0x20, 0x01, 0xFF, 0xC2, 0x00, 0x00, 0x00, 0x00];
let tlpfmt = TlpFmt::NoDataHeader3DW;

let msg_req: Box<dyn MessageRequest> = new_msg_req(bytes, &tlpfmt);

println!("Requester ID from Message{}", msg_req.req_id());