Expand description
§Bulletin Board Client
A rust client for the bulletin board.
§Examples
To post and read the bulletins,
use bulletin_board_client as bbclient;
use bbclient::*;
let data: ArrayObject = vec![1f32, 2., -3., 5.].try_into().unwrap();
bbclient::post("x", "tag", data.clone()).unwrap();
let recv = bbclient::read("x", Some("tag"), vec![]).unwrap().pop().unwrap();
let restored = recv.try_into().unwrap();
assert_eq!(data, restored);Make the data persistent.
use bulletin_board_client as bbclient;
bbclient::archive("acv", "x", Some("tag")).unwrap();
bbclient::reset_server().unwrap(); // Delete all temporary data.
bbclient::load("acv").unwrap();
dbg!(bbclient::view_board().unwrap());Modules§
- adaptor
- Adaptors for Complex and Array. These can be used to restore the data or construct ArrayObject without num::complex, ndarray or nalgebra.
- low_
level - Low-level functions that isolate the opening and closing functions of a socket. These can be used to speed up commucation with the server when you do many operations at the same time.
Structs§
- Array
Object - The main array storage with type abstraction.
Enums§
- Data
Type - The type of the elements.
Traits§
Functions§
- archive
- Moves a bulletin to a persistent archive.
- clear_
log - Clears the log file of the server.
- clear_
revisions - Deletes specific revisions from a bulletin.
- client_
version - Returns the version of the client.
- delete_
archive - Deletes an archive. This will be applied after after calling reset_server.
- dump
- Dumps all the unarchived data into an archive.
- get_
info - Returns the details of a bulletin. The return values are a vector of (revision number, datasize (bytes), timestamp, backend).
- list_
archive - Shows the list of archive.
- load
- Loads or reloads an archive. The data is directly read from the archive file and a suffix “acv_name:” is added to the tag.
- log
- Returns the log of the server.
- post
- Posts an ArrayObject.
- post_
as_ it_ is - Posts an ArrayObject without compression.
- read
- Reads ArrayObjects.
- relabel
- Relabels a bulletin.
- remove
- Removes all the revisions and the database entry of a bulletin.
- rename_
archive - Renames an archive. This will be applied after after calling reset_server.
- reset_
server - Resets and clears the data. The archived data is not affected, but must be loaded before use.
- restore
- Delete all the temporary data and restores data from an archive. Each data is copied to memory or a separate file. No suffix is added to the tag.
- server_
version - Returns the version of the server.
- set_
addr - Sets the server address.
- set_
timeout - Sets timeout for TCP stream connect. Setting it to None disable timeout.
- status
- Returns the status of the server.
- terminate_
server - Terminates the server.
- view_
board - Returns the list of the bulletins.