pub fn new_cmpl_req(
bytes: impl Into<Vec<u8>>,
) -> Result<Box<dyn CompletionRequest>, TlpError>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).unwrap();
println!("Requester ID from Completion{}", cmpl_req.req_id());§Errors
TlpError::InvalidLengthifbytes.len() < 8(CompletionReqDW23 reads a 64-bit field).