wick-stdlib 0.2.0

The default standard library for the Wick project.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use futures::StreamExt;
use seeded_random::Random;
use wick_packet::{fan_out, Observer, Packet, PacketStream};

use crate::request_response;

request_response!(job, minijob => {
  inputs: {
    seed => u64,
  },
  output: "output",
});

pub(crate) fn minijob(seed: u64) -> Result<String, wick_packet::Error> {
  let rng = Random::from_seed(seeded_random::Seed::unsafe_new(seed));
  Ok(rng.uuid().as_hyphenated().to_string())
}