/// Reads tuple from the tuple space; non-blocking
///
/// If nothing found, returns empty vector.
///
/// # Examples
///
/// ```
/// let tuple = conn.read_nb_tuple(&vec![E::I(123), E::S("123".to_string())]).unwrap();
/// ```
///
/// # Errors
///
/// Returns Err if disconnected, or incorrect data arrived
Reads tuple from the tuple space; non-blocking
If nothing found, returns empty vector.
Reads tuple from the tuple space ; non - blocking If nothing found returns empty vector .
pub fn read_nb_tuple(&self, tuple: &Vec<E>) -> std::io::Result<Vec<E>>
	{
		let mut stream_err = TcpStream::connect(&self.connection);
		match stream_err {
			Ok(mut stream) => {
				stream.write_all(&ti(READ_NB));
				send_tuple(tuple, &mut stream);
				stream.shutdown(Shutdown::Write);
				return Ok(recv_tuple(&mut stream));
			}
			Err(why) => {
				return Err(why);
			}
		}
	}
pub fn read_nb_tuple ( & self , tuple : & Vec < E > ) -> std :: io :: Result < Vec < E > > { let mut stream_err = TcpStream :: connect ( & self . connection ) ; match stream_err { Ok ( mut stream ) => { stream . write_all ( & ti ( READ_NB ) ) ; send_tuple ( tuple , & mut stream ) ; stream . shutdown ( Shutdown :: Write ) ; return Ok ( recv_tuple ( & mut stream ) ) ; } Err ( why ) => { return Err ( why ) ; } } }
Reads tuple from the tuple space; non-blocking
If nothing found, returns empty vector.
Reads tuple from the tuple space ; non - blocking If nothing found returns empty vector .
&self
tuple
&Vec<E>
examples
None
errors
Returns Err if disconnected, or incorrect data arrived
Returns Err if disconnected or incorrect data arrived