deboa-extras-0.0.9-beta.1 has been yanked.
Deboa Extras
This crate provides additional features for Deboa like compression and serialization.
Install
Either run from command line:
cargo add deboa-extras
Or add to your Cargo.toml:
= "0.0.1"
Features
jsonserializationmsgpackserializationxmlserializationgzipcompressionbrotlicompressiondeflatecompressionwebsocketsupportssesupport
Usage
Decompression
use ;
use ;
let encoding_catcher = register_decoders;
let client = builder
.catch
.build?
let posts = get?
.send_with
.await?
.body_as?;
println!;
Serialization
use ;
use JsonBody;
let client = default;
let data = Post ;
let response = post?
.body_as?
.send_with
.await?;
println!;
SSE
use ;
use ;
let client = default;
let response = client.execute.await?.into_event_stream;
// Poll events, until the connection is closed
// please note that this is a blocking call
while let Some = response.next.await
println!;
Websockets
use ;
use ;
let client = default;
let websocket = websocket?
.send_with
.await?
.into_websocket
.await;
while let Ok = websocket.read_message.await
License
MIT
Author
Rogerio Pereira Araujo rogerio.araujo@gmail.com