futuresdr_remote/
lib.rs

1#![warn(missing_docs)]
2//! # Remote interaction with FutureSDR
3//!
4//! Library for remote interaction with a FutureSDR runtime and flowgraph.
5//!
6//! ## Example
7//! ```no_run
8//! use futuresdr_remote::Error;
9//! use futuresdr_remote::Handler;
10//! use futuresdr_remote::Remote;
11//! use futuresdr_types::Pmt;
12//!
13//! #[tokio::main]
14//! async fn main() -> Result<(), Error> {
15//!     let remote = Remote::new("http://127.0.0.1:1337");
16//!
17//!     let fgs = remote.flowgraphs().await?;
18//!     let blocks = fgs[0].blocks();
19//!
20//!     let p = blocks[0].callback(Handler::Id(0), Pmt::U32(123)).await?;
21//!     println!("result: {:?}", p);
22//!
23//!     Ok(())
24//! }
25//! ```
26mod remote;
27pub use remote::Block;
28pub use remote::Connection;
29pub use remote::ConnectionType;
30pub use remote::Flowgraph;
31pub use remote::Handler;
32pub use remote::Remote;
33
34use thiserror::Error;
35
36/// FutureSDR Remote Error
37#[derive(Debug, Error)]
38pub enum Error {
39    /// Error in [`hyper`] crate.
40    #[error("Reqwest")]
41    Reqwest(#[from] reqwest::Error),
42    /// Wrong [`Flowgraph`] ID.
43    #[error("Wrong flowgraph id")]
44    FlowgraphId(usize),
45}