bulletin-board-client

Crates.iobulletin-board-client
lib.rsbulletin-board-client
version
sourcesrc
created_at2024-10-13 20:29:51.331959+00
updated_at2025-03-06 16:08:43.633565+00
descriptionRust client for BulletinBoard
homepage
repositoryhttps://github.com/YShoji-HEP/BulletinBoard
max_upload_size
id1407661
Cargo.toml error:TOML parse error at line 17, column 1 | 17 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
Yutaro Shoji (YShoji-HEP)

documentation

README

Rust client for BulletinBoard

"Buy Me A Coffee"

"Github Sponsors" Crates.io Crates.io License

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 and dbgbb 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" 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(...).
BB_TIMEOUT Unset Timeout for TCP connection.

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.
dry_run Skip all communication with the server.
Commit count: 46

cargo fmt