diff --git a/examples/sender.rs b/examples/sender.rs index 77efef8..d5b200d 100644 --- a/examples/sender.rs +++ b/examples/sender.rs @@ -18,7 +18,7 @@ fn main() { }; match send_one_value(&command) { - Ok(response) => println!("{:?}", response), + Ok(response) => println!("{:?} is success {} ", response, response.success()), Err(e) => println!("Error {}", e), } } diff --git a/src/lib.rs b/src/lib.rs index 17600b9..67acbea 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -166,3 +166,10 @@ pub struct Response { response: String, info: String, } + +impl Response { + /// Verifies successful if there was a request + pub fn success(&self) -> bool { + self.response == "success" + } +}