Function rusp::usp_generator::usp_add_response[][src]

pub fn usp_add_response<'a>(
    result: Vec<(&'a str, Result<(&'a str, Vec<(&'a str, u32, &'a str)>, Vec<(&'a str, &'a str)>), (u32, &'a str)>)>
) -> Body<'a>

Creates a body for a USP Msg with a USP AddResp response

Arguments

  • result - A vector of Result tuples to put into the AddResp response

Example

use rusp::usp_generator::usp_add_response;
let resp = usp_add_response(vec![
        ("Device.", Ok(("Device.", vec![("", 0, "")] , vec![("Foo", "Bar")]))),
        ("Dev.", Err((7000, "Message failed"))),
    ]);