pub fn new_cmpl_req(
bytes: Vec<u8>,
_format: &TlpFmt,
) -> Box<dyn CompletionRequest>
Expand description
Obtain Completion Request dyn Trait:
ยงExamples
use rtlp_lib::TlpFmt;
use rtlp_lib::CompletionRequest;
use rtlp_lib::new_cmpl_req;
let bytes = vec![0x20, 0x01, 0xFF, 0xC2, 0x00, 0x00, 0x00, 0x00];
// TLP Format usually comes from TlpPacket or Header here we made up one for example
let tlpfmt = TlpFmt::WithDataHeader4DW;
let cmpl_req: Box<dyn CompletionRequest> = new_cmpl_req(bytes, &tlpfmt);
println!("Requester ID from Completion{}", cmpl_req.req_id());