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

pub struct Linked<ModelType: 'static + Model + Debug> { /* fields omitted */ }

Wraps Model types to add references to the Database, adding new accessor methods.

Methods

impl<ModelType: Model> Linked<ModelType>[src]

pub fn new(database: Arc<Database>, item: &'static ModelType) -> Self[src]

pub fn as_static(&self) -> &'static ModelType[src]

Returns the underlying static model instance reference.

impl Linked<Run>[src]

pub fn time_ms(&self) -> u64[src]

Returns the primary timing for this run.

pub fn game(&self) -> Linked<Game>[src]

Returns the Linked for this Run.

pub fn category(&self) -> Linked<Category>[src]

Returns the Linked for this Run.

pub fn level(&self) -> Option<Linked<Level>>[src]

Returns Some(Linked) for this Run, or None if it's a full-game run.

pub fn slug(&self) -> String[src]

Returns a URL-safe slug identifying this run within its given game, category, and level (it may conflict with slugs in others).

pub fn users(&self) -> Vec<Linked<User>>[src]

Returns Vec<Linked> for this Run. May be empty if all runners unregistered/guests.

impl Linked<Game>[src]

pub fn runs(&self) -> Vec<Linked<Run>>[src]

Returns a Vec of all the verified Runs for this Game.

pub fn per_game_category_by_slug(&self, slug: &str) -> Option<Linked<Category>>[src]

pub fn per_level_category_by_slug(&self, slug: &str) -> Option<Linked<Category>>[src]

pub fn level_by_slug(&self, slug: &str) -> Option<Linked<Level>>[src]

impl Linked<Level>[src]

pub fn game(&self) -> Linked<Game>[src]

Returns the Linked for this Level.

impl Linked<Category>[src]

pub fn game(&self) -> Linked<Game>[src]

Returns the Linked for this Category.

pub fn runs(&self) -> Vec<Linked<Run>>[src]

pub fn full_runs(&self) -> Vec<Linked<Run>>[src]

pub fn level_runs(&self, level: &Level) -> Vec<Linked<Run>>[src]

Trait Implementations

impl<ModelType: Clone + 'static + Model + Debug> Clone for Linked<ModelType>[src]

impl<ModelType: Debug + 'static + Model> Debug for Linked<ModelType>[src]

impl<ModelType: Model> Deref for Linked<ModelType>[src]

type Target = ModelType

The resulting type after dereferencing.

fn deref(&self) -> &ModelType[src]

Deref to enable method delegation, but this loses the 'static lifetime.

impl<ModelType: 'static + Model + Debug> Serialize for Linked<ModelType> where
    ModelType: Serialize
[src]

Auto Trait Implementations

impl<ModelType> RefUnwindSafe for Linked<ModelType> where
    ModelType: RefUnwindSafe

impl<ModelType> Send for Linked<ModelType> where
    ModelType: Sync

impl<ModelType> Sync for Linked<ModelType> where
    ModelType: Sync

impl<ModelType> Unpin for Linked<ModelType>

impl<ModelType> UnwindSafe for Linked<ModelType> where
    ModelType: RefUnwindSafe

Blanket Implementations

impl<T, A, P> Access<T> for P where
    A: Access<T>,
    P: Deref<Target = A>, 
[src]

type Guard = <A as Access<T>>::Guard

A guard object containing the value and keeping it alive. Read more

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, A> DynAccess<T> for A where
    A: Access<T>,
    <A as Access<T>>::Guard: 'static, 
[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>,