Crates.io | leap_client_rs |
lib.rs | leap_client_rs |
version | 0.1.5 |
source | src |
created_at | 2022-09-04 21:01:41.094336 |
updated_at | 2023-10-08 01:33:34.063897 |
description | Rust client library for the Leap Edge socket service |
homepage | https://hop.io |
repository | https://github.com/hopinc/leap_client_rs#readme |
max_upload_size | |
id | 658452 |
size | 99,896 |
Utility library for connecting and receiving events from Leap Edge. Used for Channels and Pipe.
Add this to your Cargo.toml
:
[dependencies]
leap_edge_rs = "0.1"
or if you want to add features:
[dependencies.leap_edge_rs]
version = "0.1"
default-features = false
features = ["rustls-tls-webpki-roots", "zlib"]
use leap_edge_rs::{LeapEdge, LeapOptions, leap::types::Event};
#[tokio::main]
async fn main() -> Result<(), std::io::Error> {
let leap = LeapEdge::new(LeapOptions {
project: "my-project",
..Default::default()
}).await?;
leap.channel_subscribe("my-channel").await?;
while let Some(event) = leap.listen().await {
println!("{:?}", event);
}
}
use leap_edge_rs::{LeapEdge, LeapOptions};
#[tokio::main]
async fn main() -> Result<(), std::io::Error> {
let leap = LeapEdge::new(LeapOptions {
project: "my-project",
..Default::default()
}).await?;
while let Some(event) = leap.listen().await {
println!("{:?}", event);
}
}
use leap_edge_rs::{LeapEdge, LeapOptions, leap::types::Event};
#[tokio::main]
async fn main() -> Result<(), std::io::Error> {
let leap = LeapEdge::new(LeapOptions {
project: "my-project",
..Default::default()
}).await?;
while let Some(event) = leap.listen().await {
match event {
Event::Message(message) | Event::DirectMessage(message) => println!("{:?}", message),
_ => {}
}
}
}