Struct Client

Source
pub struct Client<'a> { /* private fields */ }
Expand description

Client for accessing Listen Notes API.

Implementations§

Source§

impl Client<'_>

Source

pub fn new(id: Option<&str>) -> Client<'_>

Creates new Listen API Client.

Uses default HTTP client with 30 second timeouts.

To access production API:

let client = podcast_api::Client::new(Some("YOUR-API-KEY"));

To access mock API:

let client = podcast_api::Client::new(None);
Source

pub fn new_custom<'a>( client: Client, id: Option<&'a str>, user_agent: Option<&'a str>, ) -> Client<'a>

Creates new Listen API Client with user provided HTTP Client.

Source

pub async fn search(&self, parameters: &Value) -> Result<Response>

Calls GET /search with supplied parameters.

Source

pub async fn search_episode_titles( &self, parameters: &Value, ) -> Result<Response>

Calls GET /search_episode_titles with supplied parameters.

Source

pub async fn typeahead(&self, parameters: &Value) -> Result<Response>

Calls GET /typeahead with supplied parameters.

Source

pub async fn spellcheck(&self, parameters: &Value) -> Result<Response>

Calls GET /spellcheck with supplied parameters.

Calls GET /related_searches with supplied parameters.

Calls GET /trending_searches with supplied parameters.

Source

pub async fn fetch_best_podcasts(&self, parameters: &Value) -> Result<Response>

Calls GET /best_podcasts with supplied parameters.

Source

pub async fn fetch_podcast_by_id( &self, id: &str, parameters: &Value, ) -> Result<Response>

Calls GET /podcasts/{id} with supplied parameters.

Source

pub async fn batch_fetch_podcasts(&self, parameters: &Value) -> Result<Response>

Calls POST /podcasts with supplied parameters.

Source

pub async fn fetch_episode_by_id( &self, id: &str, parameters: &Value, ) -> Result<Response>

Calls GET /episodes/{id} with supplied parameters.

Source

pub async fn batch_fetch_episodes(&self, parameters: &Value) -> Result<Response>

Calls POST /episodes with supplied parameters.

Source

pub async fn fetch_curated_podcasts_list_by_id( &self, id: &str, parameters: &Value, ) -> Result<Response>

Calls GET /curated_podcasts/{id} with supplied parameters.

Source

pub async fn fetch_curated_podcasts_lists( &self, parameters: &Value, ) -> Result<Response>

Calls GET /curated_podcasts with supplied parameters.

Source

pub async fn fetch_podcast_genres(&self, parameters: &Value) -> Result<Response>

Calls GET /genres with supplied parameters.

Source

pub async fn fetch_podcast_regions( &self, parameters: &Value, ) -> Result<Response>

Calls GET /regions with supplied parameters.

Source

pub async fn fetch_podcast_languages( &self, parameters: &Value, ) -> Result<Response>

Calls GET /languages with supplied parameters.

Source

pub async fn just_listen(&self, parameters: &Value) -> Result<Response>

Calls GET /just_listen with supplied parameters.

Source

pub async fn fetch_recommendations_for_podcast( &self, id: &str, parameters: &Value, ) -> Result<Response>

Calls GET /podcasts/{id}/recommendations with supplied parameters.

Source

pub async fn fetch_recommendations_for_episode( &self, id: &str, parameters: &Value, ) -> Result<Response>

Calls GET /episodes/{id}/recommendations with supplied parameters.

Source

pub async fn fetch_playlist_by_id( &self, id: &str, parameters: &Value, ) -> Result<Response>

Calls GET /playlists/{id} with supplied parameters.

Source

pub async fn fetch_my_playlists(&self, parameters: &Value) -> Result<Response>

Calls GET /playlists with supplied parameters.

Source

pub async fn submit_podcast(&self, parameters: &Value) -> Result<Response>

Calls POST /podcasts/submit with supplied parameters.

Source

pub async fn delete_podcast( &self, id: &str, parameters: &Value, ) -> Result<Response>

Calls DELETE /podcasts/{id} with supplied parameters.

Source

pub async fn fetch_audience_for_podcast( &self, id: &str, parameters: &Value, ) -> Result<Response>

Calls GET /podcasts/{id}/audience with supplied parameters.

Source

pub async fn fetch_podcasts_by_domain( &self, domain_name: &str, parameters: &Value, ) -> Result<Response>

Calls GET /podcasts/domains/{domain_name} with supplied parameters.

Auto Trait Implementations§

§

impl<'a> Freeze for Client<'a>

§

impl<'a> !RefUnwindSafe for Client<'a>

§

impl<'a> Send for Client<'a>

§

impl<'a> Sync for Client<'a>

§

impl<'a> Unpin for Client<'a>

§

impl<'a> !UnwindSafe for Client<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

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

fn in_current_span(self) -> Instrumented<Self>

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

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T