toornament 2.1.0

Library for Toornament.com the eSports platform
Documentation
use *;

/// Tournament stages iterator
pub struct StagesIter<'a> {
    client: &'a Toornament,

    /// Fetch stages of the following tournament id
    tournament_id: TournamentId,
}
impl<'a> StagesIter<'a> {
    /// Create new stages iter
    pub fn new(client: &'a Toornament, tournament_id: TournamentId) -> StagesIter {
        StagesIter {
            client,
            tournament_id,
        }
    }
}

/// Terminators
impl<'a> StagesIter<'a> {
    /// Collect the stages
    pub fn collect<T: From<Stages>>(self) -> Result<T> {
        Ok(T::from(self.client.tournament_stages(self.tournament_id)?))
    }
}