Enum bonsaidb_core::document::AnyDocumentId
source · [−]pub enum AnyDocumentId<PrimaryKey> {
Serialized(DocumentId),
Deserialized(PrimaryKey),
}Expand description
A unique id for a document, either serialized or deserialized.
Variants
Serialized(DocumentId)
A serialized id.
Deserialized(PrimaryKey)
A deserialized id.
Implementations
sourceimpl<PrimaryKey> AnyDocumentId<PrimaryKey> where
PrimaryKey: for<'k> Key<'k>,
impl<PrimaryKey> AnyDocumentId<PrimaryKey> where
PrimaryKey: for<'k> Key<'k>,
sourcepub fn to_document_id(&self) -> Result<DocumentId, Error>
pub fn to_document_id(&self) -> Result<DocumentId, Error>
Converts this value to a document id.
sourcepub fn to_primary_key(&self) -> Result<PrimaryKey, Error>
pub fn to_primary_key(&self) -> Result<PrimaryKey, Error>
Converts this value to the primary key type.
Trait Implementations
sourceimpl<PrimaryKey> From<DocumentId> for AnyDocumentId<PrimaryKey>
impl<PrimaryKey> From<DocumentId> for AnyDocumentId<PrimaryKey>
sourcefn from(id: DocumentId) -> Self
fn from(id: DocumentId) -> Self
Performs the conversion.
Auto Trait Implementations
impl<PrimaryKey> RefUnwindSafe for AnyDocumentId<PrimaryKey> where
PrimaryKey: RefUnwindSafe,
impl<PrimaryKey> Send for AnyDocumentId<PrimaryKey> where
PrimaryKey: Send,
impl<PrimaryKey> Sync for AnyDocumentId<PrimaryKey> where
PrimaryKey: Sync,
impl<PrimaryKey> Unpin for AnyDocumentId<PrimaryKey> where
PrimaryKey: Unpin,
impl<PrimaryKey> UnwindSafe for AnyDocumentId<PrimaryKey> where
PrimaryKey: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more