jupyter_client/
lib.rs

1#![deny(missing_docs)]
2// TODO
3/*! Jupyter Client
4
5A Rust implementation of the [Jupyter client][jupyter-client].
6
7## Examples
8
9```no_run
10extern crate jupyter_client;
11
12# use std::collections::HashMap;
13# use std::thread;
14use jupyter_client::Client;
15use jupyter_client::commands::Command;
16# use jupyter_client::Result;
17# fn main() -> Result<()> {
18
19let client = Client::existing()?;
20
21// Set up the heartbeat watcher
22let hb_receiver = client.heartbeat()?;
23thread::spawn(move || {
24    for _ in hb_receiver {
25        println!("Received heartbeat from kernel");
26    }
27});
28
29// Spawn an IOPub watcher
30let receiver = client.iopub_subscribe()?;
31thread::spawn(move || {
32    for msg in receiver {
33        println!("Received message from kernel: {:#?}", msg);
34    }
35});
36
37// Command to run
38let command = Command::Execute {
39    code: "a = 10".to_string(),
40    silent: false,
41    store_history: true,
42    user_expressions: HashMap::new(),
43    allow_stdin: true,
44    stop_on_error: false,
45};
46
47// Run some code on the kernel
48let response = client.send_shell_command(command)?;
49# Ok(())
50# }
51```
52
53[jupyter-client]: https://github.com/jupyter/jupyter_client
54*/
55
56extern crate chrono;
57extern crate dirs;
58extern crate failure;
59extern crate glob;
60extern crate hex;
61extern crate hmac;
62extern crate log;
63extern crate serde;
64extern crate serde_derive;
65extern crate serde_json;
66extern crate sha2;
67extern crate uuid;
68extern crate zmq;
69
70#[cfg(test)]
71extern crate crypto_mac;
72#[cfg(test)]
73extern crate digest;
74#[cfg(test)]
75extern crate generic_array;
76
77#[cfg(test)]
78#[macro_use]
79mod test_helpers;
80
81mod client;
82pub mod commands;
83mod connection_config;
84mod errors;
85mod header;
86mod metadata;
87mod paths;
88pub mod responses;
89mod signatures;
90mod socket;
91mod wire;
92
93pub use client::Client;
94pub use errors::Result;