pub struct WatchmodeClient { /* private fields */ }Implementations§
Source§impl WatchmodeClient
impl WatchmodeClient
Sourcepub fn new(api_key: impl Into<String>) -> Result<Self, WatchmodeError>
pub fn new(api_key: impl Into<String>) -> Result<Self, WatchmodeError>
Create a client with a conservative in-memory availability cache.
Sourcepub fn with_cache_ttl(
api_key: impl Into<String>,
cache_ttl: Duration,
) -> Result<Self, WatchmodeError>
pub fn with_cache_ttl( api_key: impl Into<String>, cache_ttl: Duration, ) -> Result<Self, WatchmodeError>
Configure the in-memory availability cache lifetime using the default API endpoint.
Sourcepub fn with_options(
api_key: impl Into<String>,
base_url: impl Into<String>,
cache_ttl: Duration,
) -> Result<Self, WatchmodeError>
pub fn with_options( api_key: impl Into<String>, base_url: impl Into<String>, cache_ttl: Duration, ) -> Result<Self, WatchmodeError>
Configure the endpoint and in-memory availability cache lifetime.
Sourcepub async fn offers_for_tmdb_id(
&self,
tmdb_id: u64,
kind: MediaKind,
region: &str,
) -> Result<Vec<StreamingOffer>, WatchmodeError>
pub async fn offers_for_tmdb_id( &self, tmdb_id: u64, kind: MediaKind, region: &str, ) -> Result<Vec<StreamingOffer>, WatchmodeError>
Search Watchmode by a TMDB movie or TV ID and fetch its regional offers.
The TMDB identifier is used to resolve the Watchmode title ID first. This avoids assuming that IDs are shared across catalogue providers.
Sourcepub async fn sources_for_title(
&self,
watchmode_id: u64,
media_item_id: MediaItemId,
region: &str,
) -> Result<Vec<StreamingOffer>, WatchmodeError>
pub async fn sources_for_title( &self, watchmode_id: u64, media_item_id: MediaItemId, region: &str, ) -> Result<Vec<StreamingOffer>, WatchmodeError>
Fetch offers for a Watchmode title ID in one region.
Sourcepub async fn list_sources(
&self,
region: &str,
) -> Result<Vec<WatchmodeSource>, WatchmodeError>
pub async fn list_sources( &self, region: &str, ) -> Result<Vec<WatchmodeSource>, WatchmodeError>
List source metadata for a region. IDs and names come from Watchmode.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for WatchmodeClient
impl !UnwindSafe for WatchmodeClient
impl Freeze for WatchmodeClient
impl Send for WatchmodeClient
impl Sync for WatchmodeClient
impl Unpin for WatchmodeClient
impl UnsafeUnpin for WatchmodeClient
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