8 releases
new 0.3.1 | Nov 16, 2024 |
---|---|
0.3.0 | Nov 9, 2024 |
0.2.0 | Nov 3, 2024 |
0.1.4 | Oct 24, 2024 |
#730 in Debugging
1,049 downloads per month
Used in 2 crates
30KB
486 lines
Rust client for BulletinBoard
BulletinBoard
is an object strage for ArrayObject
for debugging and data taking purposes.
For more details, see BulletinBoard
.
Caution
- Clients do not check whether the operation is successful or not to improve performance. Check the log of the server for the errors.
- The data is not encrypted. Please do not send any confidential data over the network.
- This crate is under development and is subject to change in specification. (Compatibility across
BulletinBoard
anddbgbb
is ensured for the most minor version numbers.) - The included tests will access the server and potentially erase existing data.
Example
Before using bulletin-board-client
, you must set up a BulletinBoard
server and set the server address in the environmental variable. It is convenient to set it in .cargo/config.toml
of your Rust project:
[env]
BB_ADDR = "ADDRESS:PORT" // or "PATH" for Unix socket
To post and read the bulletins,
use bulletin_board_client as bbclient;
use bbclient::*;
fn main() {
let data: ArrayObject = vec![1f32, 2., -3., 5.].try_into().unwrap();
bbclient::post("x", "tag", data.clone()).unwrap();
let recv = bbclient::read("x", None, vec![]).unwrap().pop().unwrap();
let restored = recv.try_into().unwrap();
assert_eq!(data, restored);
}
To make the data persistent,
use bulletin_board_client as bbclient;
fn main() {
bbclient::archive("acv", "x", Some("tag")).unwrap();
bbclient::reset_server().unwrap(); // Delete all temporary data.
bbclient::load("acv").unwrap();
dbg!(bbclient::view_board().unwrap());
}
See the docs for the details of functions.
Environment Variables
Variable | Default | Description |
---|---|---|
BB_ADDR | "127.0.0.1:7578" or "/tmp/bb.sock" | Address of the bulletin board server. It is either [IP address]:[port] or [hostname]:[port]. If you use a Unix socket, the address should be the path to an uncreated socket. The address can be modified later by calling set_addr(...) . |
Crate Features
Feature | Description |
---|---|
ndarray_15 |
Enable ndarray support. The compatible version is 0.15.x. |
ndarray_16 |
Enable ndarray support. The compatible version is 0.16.x. |
nalgebra |
Enable nalgebra support. Confirmed to work with version 0.33.0. |
Dependencies
~1–3MB
~61K SLoC