Skip to main content

Crate obid

Crate obid 

Source
Expand description

This crate provides an implementation of the ObjectId data type as defined in the BSON specification.

§Usage

cargo add obid
use obid::ObjectId;

// Create a new ObjectId
let id = ObjectId::new();

// Or parse an existing one
let id: ObjectId = "536f6d652073656372657420".parse().unwrap();

§Features

  • archive: Enables serialization/deserialization using the rkyv crate.

Structs§

ObjectId
An implementation of the ObjectId data type as defined in the BSON specification.

Enums§

ObjectIdError
Represents an error that can occur when creating an ObjectId.

Functions§

rand_bytes
Return a vector (slice-able) of len cryptographically-random bytes.