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

Fields§

§client: HttpClient

Implementations§

source§

impl LichessApi<Client>

source

pub async fn get_profile(&self, request: GetRequest) -> Result<Profile>

source

pub async fn get_email_address(&self, request: GetRequest) -> Result<Email>

source

pub async fn get_preferences( &self, request: GetRequest ) -> Result<UserPreferences>

source

pub async fn get_kid_mode_status(&self, request: GetRequest) -> Result<KidMode>

source

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

source§

impl LichessApi<Client>

source

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

source§

impl LichessApi<Client>

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source§

impl LichessApi<Client>

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source§

impl LichessApi<Client>

source

pub async fn list_challenges(&self, request: GetRequest) -> Result<Challenges>

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source§

impl LichessApi<Client>

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source§

impl LichessApi<Client>

source

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

source§

impl LichessApi<Client>

source

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

source

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

source

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

source

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

source

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

source

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

source§

impl LichessApi<Client>

source

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

source

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

source

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

source§

impl LichessApi<Client>

source

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

source

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

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_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 copy 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> 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> 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> ToOwned for T
where T: Clone,

§

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>,

§

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>,

§

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