[][src]Module no_proto::pointer::ulid

Represents a ULID type which has a 6 byte timestamp and 10 bytes of randomness

Useful for storing time stamp data that doesn't have collisions.

use no_proto::error::NP_Error;
use no_proto::NP_Factory;
use no_proto::pointer::ulid::NP_ULID;
 
let factory: NP_Factory = NP_Factory::new(r#"{
   "type": "ulid"
}"#)?;

let mut new_buffer = factory.empty_buffer(None, None);
new_buffer.set("", NP_ULID::generate(1604965249484, 50))?;
 
assert_eq!("1EPQP4CEC3KANC3XYNG9YKAQ", new_buffer.get::<NP_ULID>("")?.unwrap().to_string());

Structs

NP_ULID

Holds ULIDs which are good for time series keys.