pub struct Episode {
    pub id: i64,
    pub seasonid: i64,
    pub episode: i64,
    pub media: Media,
}
Expand description

Episode struct encapsulates a media entry representing a episode

Fields§

§id: i64§seasonid: i64

Season id foreign_key

§episode: i64

episode number

§media: Media

Regerence to a media object which represents this epsiode. We are essnetially aliasing and wrapping around Media transparently, behind the scene in the db episode inherits all fields from media.

Implementations§

Method returns all of the episodes belonging to a tv show.

Arguments
  • conn - a mutable reference to a sqlx transaction.
  • media - reference to a media object which should be a tv show.

Method returns all of the episodes belonging to a season.

Arguments
  • conn - mutable reference to a sqlx transaction.
  • media - reference to a season object/entry.

Method returns a episodes discriminated by episode number, season number and tv show id

Arguments
  • conn - mutable reference to a sqlx transaction.
  • id - The id of a tv show we target
  • season_num - The season we are targetting
  • ep_num - Episode we are targetting

Function will query for the episode after the episode passed in.

Function will query for the episode after the episode passed in.

Function will query the last episode that was watched for a show.

Method deletes a episode based on the tv show id, season number, and episode number

Arguments
  • id - The id of a tv show we target
  • season_num - The season we are targetting
  • ep_num - Episode we are targetting

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more