main
Mauro D 2022-09-09 09:52:51 +00:00
parent 2e70d350ed
commit 756085ec4d
2 changed files with 8 additions and 0 deletions

View File

@ -31,5 +31,8 @@ websockets = ["tokio", "tokio-tungstenite"]
blocking = ["reqwest/blocking"] blocking = ["reqwest/blocking"]
debug = [] debug = []
[lib]
doctest = false
[profile.bench] [profile.bench]
debug = true debug = true

View File

@ -13,11 +13,15 @@
* except according to those terms. * except according to those terms.
*/ */
#[cfg(feature = "websockets")]
use futures_util::StreamExt; use futures_util::StreamExt;
#[cfg(feature = "websockets")]
use jmap_client::{client::Client, client_ws::WebSocketMessage, core::set::SetObject}; use jmap_client::{client::Client, client_ws::WebSocketMessage, core::set::SetObject};
#[cfg(feature = "websockets")]
use tokio::sync::mpsc; use tokio::sync::mpsc;
// Make sure the "websockets" feature is enabled! // Make sure the "websockets" feature is enabled!
#[cfg(feature = "websockets")]
async fn websocket() { async fn websocket() {
// Connect to the JMAP server using Basic authentication // Connect to the JMAP server using Basic authentication
let client = Client::new() let client = Client::new()
@ -82,5 +86,6 @@ async fn websocket() {
} }
fn main() { fn main() {
#[cfg(feature = "websockets")]
let _c = websocket(); let _c = websocket();
} }