pub struct DocId(/* private fields */);Available on crate feature
std only.Expand description
A document’s primary key within a Db.
Ids are assigned by Db::insert as a dense, monotonically increasing
sequence starting at 1; 0 is never assigned and can be used as a sentinel.
The id is stable for the life of the document and survives reopening the
file. Reconstruct one with DocId::from when you have stored it elsewhere.
§Examples
use bison_db::DocId;
let id = DocId::from(7);
assert_eq!(id.get(), 7);
assert_eq!(id.to_string(), "7");Implementations§
Trait Implementations§
impl Copy for DocId
impl Eq for DocId
Source§impl Ord for DocId
impl Ord for DocId
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for DocId
impl PartialOrd for DocId
impl StructuralPartialEq for DocId
Auto Trait Implementations§
impl Freeze for DocId
impl RefUnwindSafe for DocId
impl Send for DocId
impl Sync for DocId
impl Unpin for DocId
impl UnsafeUnpin for DocId
impl UnwindSafe for DocId
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more