LichessApi

Struct LichessApi 

Source
pub struct LichessApi<HttpClient> {
    pub client: HttpClient,
    /* private fields */
}

Fields§

§client: HttpClient

Implementations§

Source§

impl LichessApi<Client>

Source

pub async fn get_profile(&self) -> Result<Profile>

Source

pub async fn get_email_address(&self) -> Result<Email>

Source

pub async fn get_preferences(&self) -> Result<UserPreferences>

Source

pub async fn get_kid_mode_status(&self) -> Result<KidMode>

Source

pub async fn set_kid_mode_status( &self, request: impl Into<PostRequest>, ) -> Result<bool>

Source§

impl LichessApi<Client>

Source

pub async fn get_cloud_evaluation( &self, request: impl Into<GetRequest>, ) -> Result<Evaluation>

Source§

impl LichessApi<Client>

Source

pub async fn board_abort_game( &self, request: impl Into<PostRequest>, ) -> Result<bool>

Source

pub async fn board_berserk_game( &self, request: impl Into<PostRequest>, ) -> Result<bool>

Source

pub async fn board_stream_game_chat( &self, request: impl Into<GetRequest>, ) -> Result<impl StreamExt<Item = Result<Vec<ChatLine>>>>

Source

pub async fn board_write_in_chat( &self, request: impl Into<PostRequest>, ) -> Result<bool>

Source

pub async fn board_claim_victory( &self, request: impl Into<PostRequest>, ) -> Result<bool>

Source

pub async fn board_handle_draw( &self, request: impl Into<PostRequest>, ) -> Result<bool>

Source

pub async fn board_make_move( &self, request: impl Into<PostRequest>, ) -> Result<bool>

Source

pub async fn board_resign_game( &self, request: impl Into<PostRequest>, ) -> Result<bool>

Source

pub async fn board_create_a_seek( &self, request: impl Into<PostRequest>, ) -> Result<impl StreamExt<Item = Result<Value>>>

Source

pub async fn board_stream_incoming_events( &self, request: impl Into<GetRequest>, ) -> Result<impl StreamExt<Item = Result<Event>>>

Source

pub async fn board_stream_board_state( &self, request: impl Into<GetRequest>, ) -> Result<impl StreamExt<Item = Result<Event>>>

Source

pub async fn board_handle_takeback( &self, request: impl Into<PostRequest>, ) -> Result<bool>

Source§

impl LichessApi<Client>

Source

pub async fn bot_abort_game( &self, request: impl Into<PostRequest>, ) -> Result<bool>

Source

pub async fn bot_stream_game_chat( &self, request: impl Into<GetRequest>, ) -> Result<impl StreamExt<Item = Result<ChatLine>>>

Source

pub async fn bot_write_in_chat( &self, request: impl Into<PostRequest>, ) -> Result<bool>

Source

pub async fn bot_draw_game( &self, request: impl Into<PostRequest>, ) -> Result<bool>

Source

pub async fn bot_make_move( &self, request: impl Into<PostRequest>, ) -> Result<bool>

Source

pub async fn bot_get_online( &self, request: impl Into<GetRequest>, ) -> Result<impl StreamExt<Item = Result<OnlineBot>>>

Source

pub async fn bot_resign_game( &self, request: impl Into<PostRequest>, ) -> Result<bool>

Source

pub async fn bot_stream_incoming_events( &self, request: impl Into<GetRequest>, ) -> Result<impl StreamExt<Item = Result<Event>>>

Source

pub async fn bot_stream_board_state( &self, request: impl Into<GetRequest>, ) -> Result<impl StreamExt<Item = Result<Event>>>

Source

pub async fn bot_upgrade_account( &self, request: impl Into<PostRequest>, ) -> Result<bool>

Source§

impl LichessApi<Client>

Source

pub async fn list_challenges(&self) -> Result<Challenges>

Source

pub async fn create_challenge( &self, request: impl Into<PostRequest>, ) -> Result<ChallengeJson>

Source

pub async fn accept_challenge( &self, request: impl Into<PostRequest>, ) -> Result<bool>

Source

pub async fn decline_challenge( &self, request: impl Into<PostRequest>, ) -> Result<bool>

Source

pub async fn cancel_challenge( &self, request: impl Into<PostRequest>, ) -> Result<bool>

Source

pub async fn challenge_ai( &self, request: impl Into<PostRequest>, ) -> Result<Move>

Source

pub async fn create_open_challenge( &self, request: impl Into<PostRequest>, ) -> Result<ChallengeOpenJson>

Source

pub async fn start_clocks( &self, request: impl Into<PostRequest>, ) -> Result<bool>

Source

pub async fn add_time_to_opponent_clock( &self, request: impl Into<PostRequest>, ) -> Result<bool>

Source§

impl LichessApi<Client>

Source

pub async fn list_external_engines(&self) -> Result<Vec<ExternalEngine>>

Source

pub async fn create_external_engine( &self, request: impl Into<PostRequest>, ) -> Result<ExternalEngine>

Source

pub async fn get_external_engine( &self, request: impl Into<GetRequest>, ) -> Result<ExternalEngine>

Source

pub async fn update_external_engine( &self, request: impl Into<PutRequest>, ) -> Result<ExternalEngine>

Source

pub async fn delete_external_engine( &self, request: impl Into<DeleteRequest>, ) -> Result<bool>

Source

pub async fn analyse_with_external_engine( &self, request: impl Into<PostRequest>, ) -> Result<impl StreamExt<Item = Result<AnalysisResponse>>>

This method currently returns a 503 error (Service Unavailable) from the Lichess API

Source

pub async fn acquire_analysis_request( &self, request: impl Into<PostRequest>, ) -> Result<Option<AcquireAnalysisResponse>>

Source§

impl LichessApi<Client>

Source

pub async fn search_fide_player( &self, request: impl Into<GetRequest>, ) -> Result<Vec<Player>>

Source

pub async fn get_fide_player( &self, request: impl Into<GetRequest>, ) -> Result<Player>

Source§

impl LichessApi<Client>

Source

pub async fn export_one_game( &self, request: impl Into<GetRequest>, ) -> Result<GameJson>

Source

pub async fn export_ongoing_game( &self, request: impl Into<GetRequest>, ) -> Result<GameJson>

Source

pub async fn export_games_of_user( &self, request: impl Into<GetRequest>, ) -> Result<impl StreamExt<Item = Result<GameJson>>>

Source

pub async fn export_games_by_ids( &self, request: impl Into<PostRequest>, ) -> Result<impl StreamExt<Item = Result<GameJson>>>

Source

pub async fn stream_games_of_users( &self, request: impl Into<PostRequest>, ) -> Result<impl StreamExt<Item = Result<GameStream>>>

Source

pub async fn stream_games_by_ids( &self, request: impl Into<PostRequest>, ) -> Result<impl StreamExt<Item = Result<GameStream>>>

Source

pub async fn add_game_ids_to_stream( &self, request: impl Into<PostRequest>, ) -> Result<bool>

Source

pub async fn get_my_ongoing_games( &self, request: impl Into<GetRequest>, ) -> Result<Games>

Source

pub async fn stream_game_moves( &self, request: impl Into<GetRequest>, ) -> Result<impl StreamExt<Item = Result<Move>>>

Source

pub async fn import_game( &self, request: impl Into<PostRequest>, ) -> Result<ImportData>

Source§

impl LichessApi<Client>

Source

pub async fn send_message( &self, request: impl Into<PostRequest>, ) -> Result<bool>

Source§

impl LichessApi<Client>

Source

pub async fn test_tokens( &self, request: impl Into<PostRequest>, ) -> Result<TestResults>

Source

pub async fn revoke_token(&self) -> Result<()>

Source§

impl LichessApi<Client>

Source

pub async fn openings_masters( &self, request: impl Into<GetRequest>, ) -> Result<OpeningExplorerJson>

Source

pub async fn openings_lichess( &self, request: impl Into<GetRequest>, ) -> Result<OpeningExplorerJson>

Source

pub async fn openings_player( &self, request: impl Into<GetRequest>, ) -> Result<OpeningExplorerJson>

Source

pub async fn openings_otb( &self, request: impl Into<GetRequest>, ) -> Result<impl StreamExt<Item = Result<String>>>

Source§

impl LichessApi<Client>

Source

pub async fn get_daily_puzzle(&self) -> Result<Puzzle>

Source

pub async fn get_puzzle(&self, request: impl Into<GetRequest>) -> Result<Puzzle>

Source

pub async fn get_new_puzzle( &self, request: impl Into<GetRequest>, ) -> Result<Puzzle>

Source

pub async fn get_puzzle_activity( &self, request: impl Into<GetRequest>, ) -> Result<impl StreamExt<Item = Result<Activity>>>

Source

pub async fn get_puzzles_to_replay( &self, request: impl Into<GetRequest>, ) -> Result<Replay>

Source

pub async fn get_puzzle_dashboard( &self, request: impl Into<GetRequest>, ) -> Result<Dashboard>

Source

pub async fn get_puzzle_storm_dashboard( &self, request: impl Into<GetRequest>, ) -> Result<Dashboard>

Source

pub async fn make_puzzle_race( &self, request: impl Into<PostRequest>, ) -> Result<Race>

Source§

impl LichessApi<Client>

Source

pub async fn get_following( &self, request: impl Into<GetRequest>, ) -> Result<impl StreamExt<Item = Result<UserExtended>>>

Source

pub async fn follow_user(&self, request: impl Into<PostRequest>) -> Result<bool>

Source

pub async fn unfollow_user( &self, request: impl Into<PostRequest>, ) -> Result<bool>

Source

pub async fn block_user(&self, request: impl Into<PostRequest>) -> Result<bool>

Source

pub async fn unblock_user( &self, request: impl Into<PostRequest>, ) -> Result<bool>

Source§

impl LichessApi<Client>

Source

pub async fn get_current_simuls(&self) -> Result<Simuls>

Source§

impl LichessApi<Client>

Source

pub async fn import_pgn_into_study( &self, request: impl Into<PostRequest>, ) -> Result<StudyImportPgnChapters>

Source§

impl LichessApi<Client>

Source

pub async fn lookup_antichess( &self, request: impl Into<GetRequest>, ) -> Result<TablebaseJson>

Source

pub async fn lookup_atomic( &self, request: impl Into<GetRequest>, ) -> Result<TablebaseJson>

Source

pub async fn lookup_standard( &self, request: impl Into<GetRequest>, ) -> Result<TablebaseJson>

Source§

impl LichessApi<Client>

Source

pub async fn tv_channels(&self) -> Result<Channels>

Source

pub async fn tv_stream_current( &self, ) -> Result<impl StreamExt<Item = Result<Event>>>

Source

pub async fn tv_stream_channel_current( &self, request: impl Into<GetRequest>, ) -> Result<impl StreamExt<Item = Result<Event>>>

Source

pub async fn tv_channel_games( &self, request: impl Into<GetRequest>, ) -> Result<impl StreamExt<Item = Result<GameJson>>>

Source§

impl LichessApi<Client>

Source

pub async fn get_all_top_10(&self) -> Result<Top10s>

Source

pub async fn get_one_leaderboard( &self, request: impl Into<GetRequest>, ) -> Result<Leaderboard>

Source

pub async fn get_public_user_data( &self, request: impl Into<GetRequest>, ) -> Result<UserExtended>

Source

pub async fn get_status_of_users( &self, request: impl Into<GetRequest>, ) -> Result<Vec<User>>

Source

pub async fn get_rating_history( &self, request: impl Into<GetRequest>, ) -> Result<RatingHistory>

Source

pub async fn get_user_performance_statistics( &self, request: impl Into<GetRequest>, ) -> Result<PerfStat>

Source

pub async fn get_users_by_id( &self, request: impl Into<PostRequest>, ) -> Result<Vec<User>>

Source

pub async fn get_live_streamers(&self) -> Result<Vec<StreamingUser>>

Source

pub async fn get_crosstable( &self, request: impl Into<GetRequest>, ) -> Result<Crosstable>

Source

pub async fn autocomplete_users( &self, request: impl Into<GetRequest>, ) -> Result<Autocompletions>

Source

pub async fn add_note_to_user( &self, request: impl Into<PostRequest>, ) -> Result<Ok>

Source

pub async fn get_user_notes( &self, request: impl Into<GetRequest>, ) -> Result<Vec<UserNote>>

Source

pub async fn get_user_activity( &self, request: impl Into<GetRequest>, ) -> Result<Vec<UserActivity>>

Source§

impl LichessApi<Client>

Source

pub async fn get_ok<Q, B>(&self, request: Request<Q, B>) -> Result<bool>
where Q: QueryBounds, B: BodyBounds,

Source

pub async fn get_pgn<Q, B>( &self, request: Request<Q, B>, ) -> Result<impl StreamExt<Item = Result<String>>>
where Q: QueryBounds, B: BodyBounds,

Source

pub async fn get_empty<Q, B>(&self, request: Request<Q, B>) -> Result<()>
where Q: QueryBounds, B: BodyBounds,

Source

pub async fn get_single_model<Q, B, M>( &self, request: Request<Q, B>, ) -> Result<M>

Source

pub async fn get_streamed_models<Q, B, M>( &self, request: Request<Q, B>, ) -> Result<impl StreamExt<Item = Result<M>>>

Source§

impl<HttpClient> LichessApi<HttpClient>

Source

pub fn new(client: HttpClient, auth_token: Option<String>) -> Self

Trait Implementations§

Source§

impl<HttpClient: Clone> Clone for LichessApi<HttpClient>

Source§

fn clone(&self) -> LichessApi<HttpClient>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<HttpClient: Debug> Debug for LichessApi<HttpClient>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<HttpClient> Freeze for LichessApi<HttpClient>
where HttpClient: Freeze,

§

impl<HttpClient> RefUnwindSafe for LichessApi<HttpClient>
where HttpClient: RefUnwindSafe,

§

impl<HttpClient> Send for LichessApi<HttpClient>
where HttpClient: Send,

§

impl<HttpClient> Sync for LichessApi<HttpClient>
where HttpClient: Sync,

§

impl<HttpClient> Unpin for LichessApi<HttpClient>
where HttpClient: Unpin,

§

impl<HttpClient> UnwindSafe for LichessApi<HttpClient>
where HttpClient: UnwindSafe,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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,