sip2-client-rs
Rust SIP2 Client Library
Two Modes of Operation
Connection API
- Supports the full SIP2 specification
- Allows complete control over every fixed field and field value.
- Gracefully handles unknown / custom message fields.
Client API
- Sits atop the Connection API and provides canned requests for common tasks.
- Client methods allow the caller to send messages using a minimal number of parameters without having to create the message by hand.
Running the example
Connection API Example
use *;
let host = "localhost:6001";
let user = "sip-user";
let pass = "sip-pass";
let con = new.unwrap;
let req = new;
let resp = con.sendrecv.unwrap;
println!;
// Verify the response reports a successful login
if resp.spec.code == M_LOGIN_RESP.code
&& resp.fixed_fields.len == 1
&& resp.fixed_fields.value == "1" else
Client API example
use *;
let host = "localhost:6001";
let user = "sip-user";
let pass = "sip-pass";
let mut client = new.unwrap;
let params = new;
params.set_sip_user;
params.set_sip_pass;
let resp = client.login.unwrap;
prinln!;
match resp.ok