pub struct TmdbClient { /* private fields */ }Expand description
Client for TMDB movie and television catalogue endpoints.
Implementations§
Source§impl TmdbClient
impl TmdbClient
Sourcepub fn new(
api_key: impl Into<String>,
language: impl Into<String>,
region: impl Into<String>,
) -> Result<Self, TmdbError>
pub fn new( api_key: impl Into<String>, language: impl Into<String>, region: impl Into<String>, ) -> Result<Self, TmdbError>
Create a client using the official TMDB v3 API.
Sourcepub fn with_base_url(
api_key: impl Into<String>,
language: impl Into<String>,
region: impl Into<String>,
base_url: impl Into<String>,
) -> Result<Self, TmdbError>
pub fn with_base_url( api_key: impl Into<String>, language: impl Into<String>, region: impl Into<String>, base_url: impl Into<String>, ) -> Result<Self, TmdbError>
Create a client with a custom base URL (useful for controlled test servers).
Sourcepub async fn search_movies(
&self,
query: &str,
page: u32,
) -> Result<TmdbPage, TmdbError>
pub async fn search_movies( &self, query: &str, page: u32, ) -> Result<TmdbPage, TmdbError>
Search movies by title.
Sourcepub async fn search_tv(
&self,
query: &str,
page: u32,
) -> Result<TmdbPage, TmdbError>
pub async fn search_tv( &self, query: &str, page: u32, ) -> Result<TmdbPage, TmdbError>
Search TV shows by title.
Sourcepub async fn movie_details(&self, tmdb_id: u64) -> Result<MediaItem, TmdbError>
pub async fn movie_details(&self, tmdb_id: u64) -> Result<MediaItem, TmdbError>
Fetch normalized movie details.
Sourcepub async fn tv_details(&self, tmdb_id: u64) -> Result<MediaItem, TmdbError>
pub async fn tv_details(&self, tmdb_id: u64) -> Result<MediaItem, TmdbError>
Fetch normalized TV-show details.
Sourcepub async fn popular_movies(&self, page: u32) -> Result<TmdbPage, TmdbError>
pub async fn popular_movies(&self, page: u32) -> Result<TmdbPage, TmdbError>
Fetch popular movies, used as a default discovery candidate pool.
Sourcepub async fn popular_tv(&self, page: u32) -> Result<TmdbPage, TmdbError>
pub async fn popular_tv(&self, page: u32) -> Result<TmdbPage, TmdbError>
Fetch popular TV shows, used as a default discovery candidate pool.
Sourcepub async fn watch_providers(
&self,
tmdb_id: u64,
kind: MediaKind,
region: &str,
) -> Result<Vec<StreamingOffer>, TmdbError>
pub async fn watch_providers( &self, tmdb_id: u64, kind: MediaKind, region: &str, ) -> Result<Vec<StreamingOffer>, TmdbError>
Fetch regional streaming offers from TMDB as a fallback when Watchmode has no usable offers. Provider IDs and URLs are returned by TMDB.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for TmdbClient
impl !UnwindSafe for TmdbClient
impl Freeze for TmdbClient
impl Send for TmdbClient
impl Sync for TmdbClient
impl Unpin for TmdbClient
impl UnsafeUnpin for TmdbClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more