rustyphoenixlecture 1.0.0

This project aims to provide a simple a powerfull lecture compilation to generate html web sites
/***************************************
	Auteur : Pierre Aubert
	Mail : pierre.aubert@lapp.in2p3.fr
	Licence : CeCILL-C
****************************************/

///Counter of Id for the PContent
pub struct PIdCounter{
	///Current id of the counter
	p_id: usize,
}

impl PIdCounter{
	///Constructor of the PIdCounter
	/// # Parameters
	/// - `id` : first id of the counter
	/// # Returns
	/// Initialised PIdCounter
	pub fn new(id: usize) -> Self{
		PIdCounter {
			p_id: id
		}
	}
	///Set the current id
	/// # Parameters
	/// - `id` : new current id of the PIdCounter
	pub fn set_id(&mut self, id: usize){
		self.p_id = id;
	}
	///Get the current id
	/// # Returns
	/// Current id of the PContent to be created
	pub fn get_id(&mut self) -> usize{
		let current_id = self.p_id;
		self.p_id += 1;
		return current_id;
	}
}

#[cfg(test)]
mod tests{
	use super::*;
	
	///Test the PIdCounter
	#[test]
	fn test_id_counter(){
		let mut id = PIdCounter::new(42);
		assert_eq!(id.get_id(), 42);
		assert_eq!(id.get_id(), 43);
		assert_eq!(id.get_id(), 44);
	}
}