actix-web-pagination

Crates.ioactix-web-pagination
lib.rsactix-web-pagination
version0.1.2
sourcesrc
created_at2021-06-08 13:55:17.31261
updated_at2021-06-08 15:08:22.781606
descriptionPagination extractor for actix-web
homepage
repositoryhttps://github.com/arniu/kepton
max_upload_size
id407820
size20,862
Arniu Tseng (arniu)

documentation

https://docs.rs/actix-web-pagination

README

actix-web-pagination

Pagination extractor for actix-web.

Example

use actix_web::{App, HttpResponse, HttpServer};
use actix_web_pagination::Pagination;

#[actix_web::get("/")]
async fn list(page: Pagination) -> HttpResponse {
    println!("page: {:?}", page);
    HttpResponse::Ok().finish()
}

#[actix_web::main]
async fn main() -> actix_web::Result<()> {
    HttpServer::new(|| {
        App::new()
            .data(Pagination::config().default_per_page(50))
            .service(list)
    })
    .bind("0.0.0.0:8080")?
    .run()
    .await?;

    Ok(())
}

License

Apache or MIT

Commit count: 0

cargo fmt