rayso-rs

Crates.iorayso-rs
lib.rsrayso-rs
version0.1.2
sourcesrc
created_at2024-03-08 21:32:23.705057
updated_at2024-03-15 11:01:14.32029
descriptionAn 'API' helper for Rayso
homepage
repositoryhttps://github.com/BenMcAvoy/RaysoRS
max_upload_size
id1167327
size51,188
Ben McAvoy (BenMcAvoy)

documentation

README

RaysoRS

Dependencies:

Usage

Make sure you are running geckodriver in the background if you are doing downloads as this project uses the geckodriver webdriver.

You can use the library as follows:

use rayso_rs::{downloader, RaysoConfig};

const CODE: &str = r#"fn main() {
    println!("Hello, world!");
}"#;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let config = RaysoConfig::builder()
        .background(false)
        .padding(8)
        .code(CODE)
        .build();

    println!("Generated URL: {}", config.to_url());

    downloader::download(config).await?;

    Ok(())
}

Note: the downloader::download(config)... is the only part that requires geckodriver to be running in the background.

Commit count: 0

cargo fmt