laftel-rs 0.0.2

A Rust wrapper for the Laftel.net API
Documentation

📦 Installation

Add this to your Cargo.toml:

[dependencies]

laftel-rs = "0.1.0"

tokio = { version = "1.0", features = ["full"] } # For async support

🛠️ Usage

Asynchronous (Default)

use laftel_rs::LaftelClient;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = LaftelClient::new()?;
    
    // Search for anime
    let results = client.search_anime("전생슬").await?;
    
    if let Some(first) = results.first() {
        println!("Found: {} ({})", first.name, first.url());
        
        // Get detailed information
        let info = client.get_anime_info(first.id).await?;
        println!("Summary: {}", info.content);
    }
    
    Ok(())
}

Synchronous (Blocking)

use laftel_rs::blocking::LaftelBlockingClient;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = LaftelBlockingClient::new()?;
    
    let results = client.search_anime("전생슬")?;
    for result in results {
        println!("- {}", result.name);
    }
    
    Ok(())
}

📜 License

This project is licensed under the GPL-3.0 License - see the LICENSE file for details.

🤝 Acknowledgments

Inspired by the original Python implementation.