Crates.io | bulletin-board-client |
lib.rs | bulletin-board-client |
version | 0.3.0 |
source | src |
created_at | 2024-10-13 20:29:51.331959 |
updated_at | 2024-11-09 16:37:10.49531 |
description | Rust client for BulletinBoard |
homepage | |
repository | https://github.com/YShoji-HEP/BulletinBoard |
max_upload_size | |
id | 1407661 |
size | 25,985 |
BulletinBoard
is an object strage for ArrayObject
for debugging and data taking purposes.
For more details, see BulletinBoard
.
BulletinBoard
and dbgbb
is ensured for the most minor version numbers.)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.
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(...) . |
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. |