Crate eve_esi

Crate eve_esi 

Source
Expand description

§EVE ESI

A thread-safe, asynchronous client which provides methods & types for interaction with EVE Online’s ESI & EVE Online’s single sign-on (SSO).

§ESI Documentation

§Usage Example

Create a new ESI Client instance and request public information about a corporation from ESI.

// esi_client is asynchronous, #[tokio::main] allows for making the main function async
#[tokio::main]
async fn main() {
    // Build a new ESI Client with the builder method
    let esi_client = eve_esi::Client::builder()
    // Always set a user agent to identify your application
        .user_agent("MyApp/1.0 (contact@example.com; +https://github.com/your/repository)")
        .build()
        .expect("Failed to build Client");

    // Get information about the corporation The Order of Autumn (id: 98785281)
    let corporation = esi_client.corporation().get_corporation_information(98785281).await.unwrap();
    println!("Corporation name: {}", corporation.name);
}

§Quickstart

§ESI Client

§Making ESI Requests

§Single Sign-On (OAuth2)

§Error Types

§Custom Endpoints

§Logging

This library uses the log crate for logging. To capture log output, applications using this library should initialize a logger implementation like env_logger, simple_logger, or any other implementation of the log crate’s facade.

§Log Levels

  • Error: Used for failures that prevent successful API calls
  • Warn: Used for potential issues that don’t prevent operation but could be problematic
  • Info: Used for successful API calls and important client state changes
  • Debug: Used for detailed information about API call parameters and responses
  • Trace: Used for very detailed debugging information

§Example with env_logger

// Set RUST_LOG environment variable to control log levels
// e.g., RUST_LOG=eve_esi=debug,info

// Initialize env_logger
env_logger::init();

// Now logs from eve_esi will be captured
let esi_client = eve_esi::Client::builder()
    .user_agent("MyApp/1.0 (contact@example.com)")
    .build()
    .expect("Failed to build Client");

Re-exports§

pub use crate::builder::ClientBuilder;
pub use crate::client::Client;
pub use crate::config::Config;
pub use crate::config::ConfigBuilder;
pub use crate::error::ConfigError;
pub use crate::error::Error;
pub use crate::oauth2::error::OAuthError;
pub use crate::scope::ScopeBuilder;

Modules§

builder
EVE Online ESI Client Builder
client
EVE Online ESI Client
config
EVE Online ESI Client Config
endpoints
EVE ESI Endpoints
error
EVE ESI Runtime & Config Errors
esi
EVE ESI Request Methods
model
Data structures for EVE Online ESI API.
oauth2
EVE ESI OAuth2
scope
EVE ESI Scopes