Crate bulletin_board_client

Crate bulletin_board_client 

Source
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§

ArrayObject
The main array storage with type abstraction.

Enums§

DataType
The type of the elements.

Traits§

Pack
Convert into binary.
TryConcat
Concatenates ArrayObjects.
Unpack
Restore from binary.

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.