Skip to main content

Crate tmdb_rs

Crate tmdb_rs 

Source
Expand description

§tmdb-rs

An async, fully-typed client for TMDB (the movie database), covering API v3 and v4.

The signature feature is compile-time append_to_response: each with_* call fills one slot of the response type, so an appended payload is a plain field rather than an Option:

let tmdb = tmdb_rs::Client::with_read_token(std::env::var("TMDB_READ_TOKEN").unwrap());

let movie = tmdb.movie(550).with_credits().with_similar().send().await?;
println!("{}", movie.name);
println!("{} cast members", movie.credits.cast.len());
println!("{} similar movies", movie.similar.results.len());
// movie.images is () — it wasn't requested, and the type says so

Modules§

streamstream
stream feature: drain a paginated endpoint as a stream of items

Structs§

AccessTokenv4
a v4 user access token, from the v4 auth flow
AccountDetails
AccountListsRequest
builder for GET /account/{account_id}/lists
AccountRequest
builder for GET /account
AccountStates
AccountWatchProviders
the account’s watch provider preferences
AccountWatchProvidersRequest
builder for GET /account/watch/providers
AggregateCastMember
AggregateCredits
credits rolled up across all episodes of a series
AggregateCrewMember
AlternativeName
AlternativeTitle
AlternativeTitles
/movie or /tv alternative_titles — movies wrap it in titles, series in results
AuthorDetails
Avatar
Backdrop
an image path; call a size method for the full url
CastMember
Certification
Change
ChangeItem
Changes
Client
the entry point; clone freely, it shares one connection pool
CollectionDetails
a collection and its parts
CollectionDetailsRequest
builder for GET /collection/{id}; each with_* fills one append slot
CollectionImagesRequest
builder for GET /collection/{id}/images
CollectionShort
one collection in a search response
CollectionTranslationsRequest
builder for GET /collection/{id}/translations
CompanyAlternativeNamesRequest
builder for GET /company/{id}/alternative_names
CompanyDetails
CompanyImagesRequest
builder for GET /company/{id}/images
CompanyRequest
builder for GET /company/{id}
CompanyShort
one company in a search response
Configuration
the API-wide configuration: image base urls and sizes, change keys
ConfigurationRequest
builder for GET /configuration
ContentRating
ContentRatings
CountriesRequest
builder for GET /configuration/countries
CountryInfo
CountryProviders
one country’s watch options for a title
CountryReleaseDates
CreateGuestSessionRequest
builder for GET /authentication/guest_session/new
CreateListRequest
builder for POST /list
CreateListResponse
the answer of a list creation
CreateSessionRequest
builder for POST /authentication/session/new
CreditDetails
a single credit by its credit id
CreditEpisode
one episode credited on an episode-level credit
CreditMovie
the movie a credit points at
CreditRequest
builder for GET /credit/{id}
CreditSeason
one season credited on an episode-level credit
CreditSeries
the series a credit points at
Credits
CrewMember
Date
Date in the proleptic Gregorian calendar.
DeleteSessionRequest
builder for DELETE /authentication/session
DepartmentJobs
DiscoverMoviesRequest
builder for GET /discover/movie
DiscoverTvRequest
builder for GET /discover/tv
Episode
one episode inside a season
EpisodeAccountState
EpisodeAccountStates
an episode’s own account state
EpisodeDetails
one episode of a series
EpisodeDetailsRequest
builder for GET /tv/{id}/season/{season}/episode/{episode}; each with_* fills one append slot
EpisodeGroup
EpisodeGroupEntry
one group inside an episode group
EpisodeGroupShort
EpisodeGroups
ExternalIds
FavoriteMoviesRequest
builder for GET /account/{account_id}/favorite/movies
FavoriteTvRequest
builder for GET /account/{account_id}/favorite/tv
FindRequest
builder for GET /find/{external_id}
FindResults
everything matching one external id
FoundEpisode
one episode found by external id
FoundSeason
one season found by external id
Genre
GuestSession
GuestSessionId
a v3 guest session id
Image
ImageConfig
Images
ItemResultv4
per-item outcome of an items call
ItemStatus
the answer of item_status
ItemsResponsev4
Job
one job in an aggregate credits entry
JobsRequest
builder for GET /configuration/jobs
Keyword
KeywordMoviesRequest
builder for GET /keyword/{id}/movies
KeywordRequest
builder for GET /keyword/{id}
LanguageInfo
LanguagesRequest
builder for GET /configuration/languages
ListAddItemRequest
builder for POST /list/{id}/add_item
ListClearRequest
builder for POST /list/{id}/clear
ListDeleteRequest
builder for DELETE /list/{id}
ListDetails
a v3 list and its items
ListItemv4
one item in an add/remove/update items call
ListItemStatusRequest
builder for GET /list/{id}/item_status
ListRemoveItemRequest
builder for POST /list/{id}/remove_item
ListRequest
builder for GET /list/{id}
ListShort
one list in a list-of-lists response
Logo
an image path; call a size method for the full url
MarkFavoriteRequest
builder for POST /account/{account_id}/favorite
MovieAccountStatesRequest
builder for GET /movie/{id}/account_states
MovieAlternativeTitlesRequest
builder for GET /movie/{id}/alternative_titles
MovieCastCredit
a movie acting credit in a person’s filmography
MovieCertificationsRequest
builder for GET /certification/movie/list
MovieChange
a movie touched by a change window
MovieChangesByIdRequest
builder for GET /movie/{id}/changes
MovieChangesRequest
builder for GET /movie/changes
MovieCreditsRequest
builder for GET /movie/{id}/credits
MovieCrewCredit
a movie crew credit in a person’s filmography
MovieDetails
the primary details of a movie
MovieDetailsRequest
builder for GET /movie/{id}; each with_* fills one append slot
MovieExternalIdsRequest
builder for GET /movie/{id}/external_ids
MovieGenresRequest
builder for GET /genre/movie/list
MovieImagesRequest
builder for GET /movie/{id}/images
MovieKeywords
/movie/{id}/keywords
MovieKeywordsRequest
builder for GET /movie/{id}/keywords
MovieLatestRequest
builder for GET /movie/latest
MovieListsRequest
builder for GET /movie/{id}/lists
MovieNowPlayingRequest
builder for GET /movie/now_playing
MoviePopularRequest
builder for GET /movie/popular
MovieRecommendationsRequest
builder for GET /movie/{id}/recommendations
MovieReleaseDatesRequest
builder for GET /movie/{id}/release_dates
MovieReviewsRequest
builder for GET /movie/{id}/reviews
MovieShort
one movie in a list or search response
MovieSimilarRequest
builder for GET /movie/{id}/similar
MovieTopRatedRequest
builder for GET /movie/top_rated
MovieTranslationsRequest
builder for GET /movie/{id}/translations
MovieUpcomingRequest
builder for GET /movie/upcoming
MovieVideosRequest
builder for GET /movie/{id}/videos
MovieWatchProviderListRequest
builder for GET /watch/providers/movie
MovieWatchProvidersRequest
builder for GET /movie/{id}/watch/providers
NetworkAlternativeNamesRequest
builder for GET /network/{id}/alternative_names
NetworkDetails
NetworkImagesRequest
builder for GET /network/{id}/images
NetworkRequest
builder for GET /network/{id}
NetworkShort
one network on an episode group
NextEpisode
a series’ next aired episode
Page
one page of a paginated list endpoint
PersonChangesRequest
builder for GET /person/{id}/changes
PersonCombinedCreditsRequest
builder for GET /person/{id}/combined_credits
PersonCredits
a person’s filmography; combined, movie-only and tv-only share the shape
PersonDetails
the primary details of a person
PersonDetailsRequest
builder for GET /person/{id}; each with_* fills one append slot
PersonExternalIdsRequest
builder for GET /person/{id}/external_ids
PersonImages
PersonImagesRequest
builder for GET /person/{id}/images
PersonLatestRequest
builder for GET /person/latest
PersonMovieCreditsRequest
builder for GET /person/{id}/movie_credits
PersonPopularRequest
builder for GET /person/popular
PersonShort
one person in a list or search response
PersonTranslation
PersonTranslationData
PersonTranslations
PersonTranslationsRequest
builder for GET /person/{id}/translations
PersonTvCreditsRequest
builder for GET /person/{id}/tv_credits
Poster
an image path; call a size method for the full url
PrimaryTranslationsRequest
builder for GET /configuration/primary_translations
Profile
an image path; call a size method for the full url
ProviderRegion
RateMovieRequest
builder for POST /movie/{id}/rating
RateTvEpisodeRequest
builder for POST /tv/{id}/season/{season}/episode/{episode}/rating
RateTvRequest
builder for POST /tv/{id}/rating
RatedEpisode
one episode in the rated-episodes list
RatedEpisodesRequest
builder for GET /account/{account_id}/rated/episodes
RatedMoviesRequest
builder for GET /account/{account_id}/rated/movies
RatedTvRequest
builder for GET /account/{account_id}/rated/tv
ReleaseDate
ReleaseDates
RequestToken
RequestTokenRequest
builder for GET /authentication/token/new
Review
ReviewRequest
builder for GET /review/{id}
Role
one role in an aggregate credits entry
ScreenedEntry
one episode screened in theatres
ScreenedTheatrically
SearchCollectionsRequest
builder for GET /search/collection
SearchCompaniesRequest
builder for GET /search/company
SearchKeywordsRequest
builder for GET /search/keyword
SearchMoviesRequest
builder for GET /search/movie
SearchPeopleRequest
builder for GET /search/person
SearchRequest
builder for GET /search/multi
SearchTvRequest
builder for GET /search/tv
SeasonDetails
one season of a series, episodes included
SeasonDetailsRequest
builder for GET /tv/{id}/season/{season}; each with_* fills one append slot
SeasonShort
one season inside a series’ details
Session
SessionId
a v3 session id, from the authentication flow
SetWatchlistRequest
builder for POST /account/{account_id}/watchlist
StatusResponse
the success envelope of write endpoints
Still
an image path; call a size method for the full url
Timezone
TimezonesRequest
builder for GET /configuration/timezones
Translation
TranslationData
movies fill title, series name
Translations
TrendingAllRequest
builder for GET /trending/all/{window}
TrendingMoviesRequest
builder for GET /trending/movie/{window}
TrendingPeopleRequest
builder for GET /trending/person/{window}
TrendingTvRequest
builder for GET /trending/tv/{window}
TvAccountStatesRequest
builder for GET /tv/{id}/account_states
TvAggregateCreditsRequest
builder for GET /tv/{id}/aggregate_credits
TvAiringTodayRequest
builder for GET /tv/airing_today
TvAlternativeTitlesRequest
builder for GET /tv/{id}/alternative_titles
TvCastCredit
a series acting credit in a person’s filmography
TvCertificationsRequest
builder for GET /certification/tv/list
TvChangesByIdRequest
builder for GET /tv/{id}/changes
TvContentRatingsRequest
builder for GET /tv/{id}/content_ratings
TvCreditsRequest
builder for GET /tv/{id}/credits
TvCrewCredit
a series crew credit in a person’s filmography
TvDetails
the primary details of a series
TvDetailsRequest
builder for GET /tv/{id}; each with_* fills one append slot
TvEpisodeAccountStatesRequest
builder for GET /tv/{id}/season/{season}/episode/{episode}/account_states
TvEpisodeChangesRequest
builder for GET /tv/episode/{id}/changes
TvEpisodeCreditsRequest
builder for GET /tv/{id}/season/{season}/episode/{episode}/credits
TvEpisodeExternalIdsRequest
builder for GET /tv/{id}/season/{season}/episode/{episode}/external_ids
TvEpisodeGroupRequest
builder for GET /tv/episode_group/{id}
TvEpisodeGroupsRequest
builder for GET /tv/{id}/episode_groups
TvEpisodeImagesRequest
builder for GET /tv/{id}/season/{season}/episode/{episode}/images
TvEpisodeTranslationsRequest
builder for GET /tv/{id}/season/{season}/episode/{episode}/translations
TvEpisodeVideosRequest
builder for GET /tv/{id}/season/{season}/episode/{episode}/videos
TvExternalIdsRequest
builder for GET /tv/{id}/external_ids
TvGenresRequest
builder for GET /genre/tv/list
TvImagesRequest
builder for GET /tv/{id}/images
TvKeywords
/tv/{id}/keywords — same payload, different envelope
TvKeywordsRequest
builder for GET /tv/{id}/keywords
TvLatestRequest
builder for GET /tv/latest
TvListsRequest
builder for GET /tv/{id}/lists
TvOnTheAirRequest
builder for GET /tv/on_the_air
TvPopularRequest
builder for GET /tv/popular
TvRecommendationsRequest
builder for GET /tv/{id}/recommendations
TvReviewsRequest
builder for GET /tv/{id}/reviews
TvScreenedTheatricallyRequest
builder for GET /tv/{id}/screened_theatrically
TvSeasonAccountStatesRequest
builder for GET /tv/{id}/season/{season}/account_states
TvSeasonAggregateCreditsRequest
builder for GET /tv/{id}/season/{season}/aggregate_credits
TvSeasonChangesRequest
builder for GET /tv/season/{id}/changes
TvSeasonCreditsRequest
builder for GET /tv/{id}/season/{season}/credits
TvSeasonExternalIdsRequest
builder for GET /tv/{id}/season/{season}/external_ids
TvSeasonImagesRequest
builder for GET /tv/{id}/season/{season}/images
TvSeasonTranslationsRequest
builder for GET /tv/{id}/season/{season}/translations
TvSeasonVideosRequest
builder for GET /tv/{id}/season/{season}/videos
TvSeasonWatchProvidersRequest
builder for GET /tv/{id}/season/{season}/watch/providers
TvShort
one series in a list or search response
TvSimilarRequest
builder for GET /tv/{id}/similar
TvTopRatedRequest
builder for GET /tv/top_rated
TvTranslationsRequest
builder for GET /tv/{id}/translations
TvVideosRequest
builder for GET /tv/{id}/videos
TvWatchProviderListRequest
builder for GET /watch/providers/tv
TvWatchProvidersRequest
builder for GET /tv/{id}/watch/providers
UnrateMovieRequest
builder for DELETE /movie/{id}/rating
UnrateTvEpisodeRequest
builder for DELETE /tv/{id}/season/{season}/episode/{episode}/rating
UnrateTvRequest
builder for DELETE /tv/{id}/rating
V4v4
the v4 api surface; get one from Client::v4
V4AccessTokenv4
step 2’s answer: the user access token every other v4 call needs
V4AccessTokenRequestv4
builder for POST /auth/access_token
V4AccountListsRequestv4
builder for GET /account/{account_id}/lists
V4CreateListRequestv4
builder for POST /list
V4CreateListResponsev4
the answer of a v4 list creation
V4DeleteAccessTokenRequestv4
builder for DELETE /auth/access_token
V4DeleteListRequestv4
builder for DELETE /list/{id}
V4FavoriteMoviesRequestv4
builder for GET /account/{account_id}/movie/favorites
V4FavoriteTvRequestv4
builder for GET /account/{account_id}/tv/favorites
V4Listv4
a v4 list and one page of its items
V4ListAddItemsRequestv4
builder for POST /list/{id}/items
V4ListClearRequestv4
builder for GET /list/{id}/clear
V4ListRemoveItemsRequestv4
builder for DELETE /list/{id}/items
V4ListRequestv4
builder for GET /list/{id}
V4MarkFavoriteRequestv4
builder for POST /account/{account_id}/favorites
V4MovieRecommendationsRequestv4
builder for GET /account/{account_id}/movie/recommendations
V4RatedMoviesRequestv4
builder for GET /account/{account_id}/movie/rated
V4RatedTvRequestv4
builder for GET /account/{account_id}/tv/rated
V4RequestTokenv4
step 1’s answer: the request token to send the user to approve
V4RequestTokenRequestv4
builder for POST /auth/request_token
V4SetWatchlistRequestv4
builder for POST /account/{account_id}/watchlist
V4TvRecommendationsRequestv4
builder for GET /account/{account_id}/tv/recommendations
V4UpdateListRequestv4
builder for PUT /list/{id}
V4WatchlistMoviesRequestv4
builder for GET /account/{account_id}/movie/watchlist
V4WatchlistTvRequestv4
builder for GET /account/{account_id}/tv/watchlist
ValidateKeyRequest
builder for GET /authentication
ValidateWithLoginRequest
builder for POST /authentication/token/validate_with_login
Video
Videos
WatchProvider
WatchProviderRegionsRequest
builder for GET /watch/providers/regions
WatchProviders
the watch/providers payload, keyed by country code
WatchlistMoviesRequest
builder for GET /account/{account_id}/watchlist/movies
WatchlistTvRequest
builder for GET /account/{account_id}/watchlist/tv

Enums§

AccountSort
the sort order of account lists
CastCredit
one acting credit, discriminated by TMDB’s media_type
CountryCode
An enumeration of all ISO-3166-1 country codes
CreditMedia
the movie or series a credit points at, discriminated by TMDB’s media_type
CreditType
cast (on screen) or crew (behind it)
CrewCredit
one crew credit, discriminated by TMDB’s media_type
Error
every failure the client can produce
ExternalSource
the database an external id comes from
Language
ListType
the kind of items a v3 list holds
MediaType
movie or series, for write-endpoint bodies
MovieSort
the movie discover sort orders
MultiResult
one multi-search hit, discriminated by TMDB’s media_type
Rated
rated is false until the user rates the title, then an object
ReleaseType
TMDB’s release date kinds
TimeWindow
the trending time window
TvSort
the series discover sort orders
V4Sortv4
the v4 list sort orders

Traits§

Append
one append_to_response slot in a detail response: () when the payload was not requested, the payload type when it was
ToParam
a query param value; slices join with commas, as TMDB expects

Type Aliases§

Certifications
certifications by country code
Result