[][src]Struct speedruns::data::database::Database

pub struct Database { /* fields omitted */ }

A collection of Tables with various generated indexes.

Methods

impl Database[src]

pub fn tables(&self) -> &&'static Tables[src]

pub fn last_updated(&self) -> &DateTime<Utc>[src]

pub fn runs_by_game_id_and_category_id_and_level_id(
    &self
) -> &BTreeMap<(u64, u64, Option<u64>), Vec<&'static Run>>
[src]

pub fn per_game_categories_by_game_id_and_slug(
    &self
) -> &BTreeMap<(u64, String), &'static Category>
[src]

pub fn per_level_categories_by_game_id_and_slug(
    &self
) -> &BTreeMap<(u64, String), &'static Category>
[src]

impl Database[src]

pub fn new(tables: &'static Tables) -> Result<Arc<Self>, IntegrityErrors>[src]

Creates a new Database indexing a collection of static tables.

pub fn validate(self: &Arc<Self>) -> Result<(), IntegrityErrors>[src]

pub fn runs(self: &Arc<Self>) -> impl Iterator<Item = Linked<Run>>[src]

Iterator over all Linkeds.

pub fn run_by_id(self: &Arc<Self>, id: u64) -> Option<Linked<Run>>[src]

Finds a Linked by id.

pub fn runs_by_game_id(self: &Arc<Self>, game_id: u64) -> Vec<Linked<Run>>[src]

Returns a Vec of Linked for a given game ID, sorted by category, level, and then primary time (ascending).

pub fn users(self: &Arc<Self>) -> impl Iterator<Item = Linked<User>>[src]

Iterator over all Linkeds.

pub fn user_by_id(self: &Arc<Self>, id: u64) -> Option<Linked<User>>[src]

Finds a Linked by id.

pub fn user_by_slug(self: &Arc<Self>, slug: &str) -> Option<Linked<User>>[src]

Finds a Linked by name.

pub fn games(self: &Arc<Self>) -> impl Iterator<Item = Linked<Game>>[src]

Iterator over all Linkeds.

pub fn game_by_id(self: &Arc<Self>, id: u64) -> Option<Linked<Game>>[src]

Finds a Game by id.

pub fn game_by_slug(self: &Arc<Self>, slug: &str) -> Option<Linked<Game>>[src]

Finds a Linked by slug.

pub fn levels_by_game_id(self: &Arc<Self>, game_id: u64) -> Vec<Linked<Level>>[src]

pub fn level_by_game_id_and_slug(
    self: &Arc<Self>,
    game_id: u64,
    slug: &str
) -> Option<Linked<Level>>
[src]

Finds a level with the given name and game ID.

pub fn levels(self: &Arc<Self>) -> impl Iterator<Item = Linked<Level>>[src]

Iterator over all Linkeds.

pub fn level_by_id(self: &Arc<Self>, id: u64) -> Option<Linked<Level>>[src]

Finds a Level by id.

pub fn category_by_id(self: &Arc<Self>, id: u64) -> Option<Linked<Category>>[src]

An iterator over all Linkeds.

pub fn per_game_category_by_game_id_and_slug(
    self: &Arc<Self>,
    game_id: u64,
    slug: &str
) -> Option<Linked<Category>>
[src]

Finds a per-game category with the given slug and game ID.

pub fn per_level_category_by_game_id_and_slug(
    self: &Arc<Self>,
    game_id: u64,
    slug: &str
) -> Option<Linked<Category>>
[src]

Finds a per-level category with the given slug and game ID.

pub fn categories(self: &Arc<Self>) -> impl Iterator<Item = Linked<Category>>[src]

Iterator over all Linkeds.

Trait Implementations

impl Clone for Database[src]

impl Debug for Database[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Err = <U as TryFrom<T>>::Err

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,