/// Calculates a number tuples from the tuple space that satisfy templates
///
/// If nothing found, 0. If template list is empty, returns number of all tuples in the space.
///
/// # Examples
///
/// ```
/// let count = conn.number_of_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
Calculates a number tuples from the tuple space that satisfy templates
If nothing found, 0. If template list is empty, returns number of all tuples in the space.
Calculates a number tuples from the tuple space that satisfy templates If nothing found 0 . If template list is empty returns number of all tuples in the space .
pub fn number_of_tuples(&self, tuples: &Vec<Vec<E>>) -> std::io::Result<i32>
	{
		let mut stream_err = TcpStream::connect(&self.connection);
		match stream_err {
			Ok(mut stream) => {
				stream.write_all(&ti(COUNT));
				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) };
				return Ok(recv_count);
			}
			Err(why) => {
				return Err(why);
			}
		}
	}
pub fn number_of_tuples ( & self , tuples : & Vec < Vec < E > > ) -> std :: io :: Result < i32 > { let mut stream_err = TcpStream :: connect ( & self . connection ) ; match stream_err { Ok ( mut stream ) => { stream . write_all ( & ti ( COUNT ) ) ; 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 ) } ; return Ok ( recv_count ) ; } Err ( why ) => { return Err ( why ) ; } } }
Calculates a number tuples from the tuple space that satisfy templates
If nothing found, 0.
Calculates a number tuples from the tuple space that satisfy templates If nothing found 0 .
&self
tuples
&Vec<Vec<E>>
examples
None
errors
Returns Err if disconnected, or incorrect data arrived
Returns Err if disconnected or incorrect data arrived