pub struct ID(_);
Expand description
The Implementation of the ID that the crate uses
Example
For now, the implementation uses UUID v4 as the inner type.
use redmaple::tree::id::ID;
use uuid::Uuid;
let id = Uuid::new_v4();
assert_eq!(id, ID::new(id).inner());
assert_eq!(4usize, ID::new(id).inner().get_version_num());
We should make sure to insure that the ID::new()
never outputs a nil (all zero) id.
use redmaple::tree::id::ID;
use uuid::Uuid;
let id = Uuid::new_v4();
assert!(!ID::new(id).inner().is_nil());
Of course all ID’s should be unique.
use redmaple::tree::id::ID;
use uuid::Uuid;
let id1 = Uuid::new_v4();
let id2 = Uuid::new_v4();
assert_ne!(ID::new(id1), ID::new(id2));
Implementations§
Trait Implementations§
source§impl Ord for ID
impl Ord for ID
source§impl PartialOrd<ID> for ID
impl PartialOrd<ID> for ID
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more