actix-cbor

Crates.ioactix-cbor
lib.rsactix-cbor
version0.1.4
sourcesrc
created_at2020-09-28 20:31:43.85076
updated_at2020-09-29 00:34:08.454428
descriptionCBOR support for Actix-Web
homepage
repositoryhttps://github.com/Noah-Kennedy/actix-cbor
max_upload_size
id293851
size23,140
Noah Kennedy (Noah-Kennedy)

documentation

README

Overview

This crate provides an extractor for working with CBOR. It closely mirrors the API for JSON extraction within Actix-Web, and in fact borrows most of it's code from Actix-Web.

Example

use actix_cbor::Cbor;

struct User {
    name: String,
}
struct Greeting {
    inner: String,
}

#[get("/users/hello")]
pub async fn greet_user(user: Cbor<User>) -> Cbor<Greeting> {
    let name: &str = &user.name;
    let inner: String = format!("Hello {}!", name);
    Cbor(Greeting { inner })
}

Contributing

If you have a bug report or feature request, create a new GitHub issue.

Pull requests are welcome.

Commit count: 14

cargo fmt