[][src]Struct letterboxd::Client

pub struct Client { /* fields omitted */ }

Letterboxd asynchronous client.

Client is created from given api key pair either

  • by authenticating using a username/password,
  • with a token (all API calls will be authenticated),
  • without a token (no API calls will be authenticated; calls that require authentication will fail).

Note: Not all APIs are implemented. Feel free to contribute implementation for missing endpoints. The implementation is usually very straight forward.

Methods

impl Client[src]

pub fn new(api_key_pair: ApiKeyPair) -> Self[src]

Creates a new client without authentication.

pub fn with_token(api_key_pair: ApiKeyPair, token: AccessToken) -> Self[src]

Crates a new client from a given token.

It is not checked that the token is valid.

pub async fn authenticate<'_, '_>(
    api_key_pair: ApiKeyPair,
    username: &'_ str,
    password: &'_ str
) -> Result<Self>
[src]

Authenticates and creates a new client from given username/password.

pub fn is_authenticated(&self) -> bool[src]

Returns if the client has a token.

This method does not check that the token is valid.

pub fn token(&self) -> Option<&AccessToken>[src]

Returns the token used for authentication.

pub fn set_token(&mut self, token: Option<AccessToken>)[src]

Sets a new token which will be used for authentication.

Setting None disables authentication.

pub async fn films<'_, '_>(
    &'_ self,
    request: &'_ FilmsRequest
) -> Result<FilmsResponse>
[src]

A cursored window over the list of films.

Use the ‘next’ cursor to move through the list. The response will include the film relationships for the signed-in member and the member indicated by the member LID if specified.

pub async fn film_services<'_>(&'_ self) -> Result<FilmServicesResponse>[src]

Get a list of services supported by the /films endpoint.

Services are returned in alphabetical order. Some services are only available to paying members, so results will vary based on the authenticated member’s status.

pub async fn film_genres<'_>(&'_ self) -> Result<GenresResponse>[src]

Get a list of genres supported by the films function.

Genres are returned in alphabetical order.

pub async fn film<'_, '_>(&'_ self, id: &'_ str) -> Result<Film>[src]

Get details about a film by ID.

pub async fn film_availability<'_, '_>(
    &'_ self,
    id: &'_ str
) -> Result<FilmAvailabilityResponse>
[src]

Get availability data about a film by ID.

pub async fn film_relationship<'_, '_>(
    &'_ self,
    id: &'_ str
) -> Result<FilmAvailabilityResponse>
[src]

Get details of the authenticated member’s relationship with a film by ID.

pub async fn update_film_relationship<'_, '_, '_>(
    &'_ self,
    id: &'_ str,
    request: &'_ FilmRelationshipUpdateRequest
) -> Result<FilmRelationshipUpdateResponse>
[src]

Update the authenticated member’s relationship with a film by ID.

pub async fn film_relationship_members<'_, '_, '_>(
    &'_ self,
    id: &'_ str,
    request: &'_ MemberFilmRelationshipsRequest
) -> Result<MemberFilmRelationshipsResponse>
[src]

Get details of the authenticated member’s relationship with a film by ID.

pub async fn film_statistics<'_, '_>(
    &'_ self,
    id: &'_ str
) -> Result<FilmStatistics>
[src]

Get statistical data about a film by ID.

pub async fn lists<'_, '_>(
    &'_ self,
    request: &'_ ListsRequest
) -> Result<ListsResponse>
[src]

A cursored window over a list of lists.

Use the ‘next’ cursor to move through the list.

pub async fn create_list<'_, '_>(
    &'_ self,
    request: &'_ ListCreationRequest
) -> Result<ListCreateResponse>
[src]

Create a list.

pub async fn list<'_, '_>(&'_ self, id: &'_ str) -> Result<List>[src]

Get details of a list by ID.

pub async fn update_list<'_, '_, '_>(
    &'_ self,
    id: &'_ str,
    request: &'_ ListUpdateRequest
) -> Result<ListUpdateResponse>
[src]

Update a list by ID.

pub async fn delete_list<'_, '_>(&'_ self, id: &'_ str) -> Result<()>[src]

Delete a list by ID.

pub async fn list_entries<'_, '_, '_>(
    &'_ self,
    id: &'_ str,
    request: &'_ ListEntriesRequest
) -> Result<ListEntriesResponse>
[src]

Get entries for a list by ID.

pub async fn search<'_, '_>(
    &'_ self,
    request: &'_ SearchRequest
) -> Result<SearchResponse>
[src]

Search for any data.

Trait Implementations

impl Debug for Client[src]

Auto Trait Implementations

impl !RefUnwindSafe for Client

impl Send for Client

impl Sync for Client

impl Unpin for Client

impl !UnwindSafe for Client

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,