ids_service 2.1.3

Library that allows to generate unique Ids.
Documentation
// SPDX-License-Identifier: MIT
//! Quick start example using `rust_hash` (Rust DefaultHasher).
//! This example requires the `rust` or `all` feature.

#[cfg(feature = "rust")]
use ids_service::common::*;
#[cfg(feature = "rust")]
use ids_service::rust_hash::*;

fn main() {
    let mut ids = IdsService::default();
    ids.start();

    let _ = ids.filled_at_percent_event(10).recv();

    println!("u64    : {}", ids.get_id());
    println!("hex    : {}", ids.get_id().as_hex());
    println!("base64 : {}", ids.get_id().as_base64());
    println!("json   :\n{}", ids.get_id().as_json());
    println!(
        "cached : {}",
        ids.get_id_from_cache().expect("cache non-empty")
    );
    println!("cache len: {}", ids.get_cache_len());

    ids.stop();
}