/// Reads all tuples from the tuple space that satisfy templates
///
/// If nothing found, returns empty vector. If template list is empty, returns all tuples in the space.
///
/// # Examples
///
/// ```
/// let tuple_list = conn.read_all_tuples(&vec![vec![E::I(123), E::None], vec![E::S("123".to_string()), E::None]]).unwrap();
/// ```
///
/// # Errors
///
/// Returns Err if disconnected, or incorrect data arrived
Reads all tuples from the tuple space that satisfy templates
If nothing found, returns empty vector. If template list is empty, returns all tuples in the space.
Reads all tuples from the tuple space that satisfy templates If nothing found returns empty vector . If template list is empty returns all tuples in the space .
pub fn read_all_tuples(&self, tuples: &Vec<Vec<E>>) -> std::io::Result<Vec<Vec<E>>>
	{
		let mut stream_err = TcpStream::connect(&self.connection);
		match stream_err {
			Ok(mut stream) => {
				stream.write_all(&ti(DUMP));
				let count: i32 = tuples.len() as i32;
				stream.write_all(&ti(count));
				for tuple in tuples {
					send_tuple(tuple, &mut stream);
				}
				let mut buff_4:[u8; 4] = [0; 4];
				stream.read_exact(&mut buff_4);
				let recv_count = unsafe { transmute(buff_4) };
				let mut result:Vec<Vec<E>> = Vec::<Vec<E>>::new();
				for i in 0..recv_count {
					result.push(recv_tuple(&mut stream));
				}
				return Ok(result);
			}
			Err(why) => {
				return Err(why);
			}
		}
	}
pub fn read_all_tuples ( & self , tuples : & Vec < Vec < E > > ) -> std :: io :: Result < Vec < Vec < E > > > { let mut stream_err = TcpStream :: connect ( & self . connection ) ; match stream_err { Ok ( mut stream ) => { stream . write_all ( & ti ( DUMP ) ) ; let count : i32 = tuples . len ( ) as i32 ; stream . write_all ( & ti ( count ) ) ; for tuple in tuples { send_tuple ( tuple , & mut stream ) ; } let mut buff_4 : [ u8 ; 4 ] = [ 0 ; 4 ] ; stream . read_exact ( & mut buff_4 ) ; let recv_count = unsafe { transmute ( buff_4 ) } ; let mut result : Vec < Vec < E > > = Vec :: < Vec < E > > :: new ( ) ; for i in 0 .. recv_count { result . push ( recv_tuple ( & mut stream ) ) ; } return Ok ( result ) ; } Err ( why ) => { return Err ( why ) ; } } }
Reads all tuples from the tuple space that satisfy templates
If nothing found, returns empty vector.
Reads all tuples from the tuple space that satisfy templates If nothing found returns empty vector .
&self
tuples
&Vec<Vec<E>>
examples
None
errors
Returns Err if disconnected, or incorrect data arrived
Returns Err if disconnected or incorrect data arrived