fn decks(&self, ctx: &Context, offset: Option<i32>) -> LeagueDecks {
        use crate::schema::decks::dsl::*;
        let conn = ctx.pool.get().unwrap();

        let offset = offset.unwrap_or(0).max(0);

        let decks_ = decks.filter(league.eq(self.id)).limit(25).offset(offset as i64).get_results(&conn).unwrap();
        let total = decks.filter(league.eq(self.id)).count().get_result::<i64>(&conn).unwrap() as i32;
        LeagueDecks {
            decks: decks_,
            total,
            next_offset: if offset + 25 > total { None } else { Some(offset + 25) }
        }
    }
/// Returns up to 25 decks at a time.
Returns up to 25 decks at a time.
Returns up to 25 decks at a time .
fn decks(&self, ctx: &Context, offset: Option<i32>) -> LeagueDecks {
        use crate::schema::decks::dsl::*;
        let conn = ctx.pool.get().unwrap();
        let offset = offset.unwrap_or(0).max(0);
        let decks_ = decks.filter(league.eq(self.id)).limit(25).offset(offset as i64).get_results(&conn).unwrap();
        let total = decks.filter(league.eq(self.id)).count().get_result::<i64>(&conn).unwrap() as i32;
        LeagueDecks {
            decks: decks_,
            total,
            next_offset: if offset + 25 > total { None } else { Some(offset + 25) }
        }
    }
fn decks ( & self , ctx : & Context , offset : Option < i32 > ) -> LeagueDecks { use crate :: schema :: decks :: dsl :: * ; let conn = ctx . pool . get ( ) . unwrap ( ) ; let offset = offset . unwrap_or ( 0 ) . max ( 0 ) ; let decks_ = decks . filter ( league . eq ( self . id ) ) . limit ( 25 ) . offset ( offset as i64 ) . get_results ( & conn ) . unwrap ( ) ; let total = decks . filter ( league . eq ( self . id ) ) . count ( ) . get_result :: < i64 > ( & conn ) . unwrap ( ) as i32 ; LeagueDecks { decks : decks_ , total , next_offset : if offset + 25 > total { None } else { Some ( offset + 25 ) } } }
Returns up to 25 decks at a time.
Returns up to 25 decks at a time .
&self
ctx
&Context
offset
Option<i32>
&self
ctx
&Context
offset
Option<i32>