pub fn sequential<T>(ids: &HashSet<T>) -> BuildResult
		where T: IdResource<IdType> + Borrow<IdType> + Hash + Eq
	{
		let index_error = |index: usize| -> Error
		{
			Error::SyntaxError(format!("Invalid or missing index `{}`.", index))
		};

		let len = IdType::from(ids.len());
		if len.is_none()
		{
			return Err(index_error(0));
		}
		for i in range(IdType::zero(), len.unwrap())
		{
			if !ids.contains::<IdType>(&i)
			{
				return Err(index_error(i.to_usize().unwrap()));
			}
		}
		Ok(())
	}
/// Returns true if the set sequence is sequential, false otherwise.
///
/// The error returned here is a syntax error indicating the missing index.
///
Returns true if the set sequence is sequential, false otherwise.
The error returned here is a syntax error indicating the missing index.
Returns true if the set sequence is sequential false otherwise . The error returned here is a syntax error indicating the missing index .
pub fn sequential<T>(ids: &HashSet<T>) -> BuildResult
		where T: IdResource<IdType> + Borrow<IdType> + Hash + Eq
	{
		let index_error = |index: usize| -> Error
		{
			Error::SyntaxError(format!("Invalid or missing index `{}`.", index))
		};
		let len = IdType::from(ids.len());
		if len.is_none()
		{
			return Err(index_error(0));
		}
		for i in range(IdType::zero(), len.unwrap())
		{
			if !ids.contains::<IdType>(&i)
			{
				return Err(index_error(i.to_usize().unwrap()));
			}
		}
		Ok(())
	}
pub fn sequential < T > ( ids : & HashSet < T > ) -> BuildResult where T : IdResource < IdType > + Borrow < IdType > + Hash + Eq { let index_error = | index : usize | -> Error { Error :: SyntaxError ( format ! ( " " index ) ) } ; let len = IdType :: from ( ids . len ( ) ) ; if len . is_none ( ) { return Err ( index_error ( 0 ) ) ; } for i in range ( IdType :: zero ( ) , len . unwrap ( ) ) { if ! ids . contains :: < IdType > ( & i ) { return Err ( index_error ( i . to_usize ( ) . unwrap ( ) ) ) ; } } Ok ( ( ) ) }
Returns true if the set sequence is sequential, false otherwise.
Returns true if the set sequence is sequential false otherwise .
ids
&HashSet<T>
ids
&HashSet<T>