pub struct RegistrySegment { /* private fields */ }Expand description
Per-collection registry segment.
Implementations§
Source§impl RegistrySegment
impl RegistrySegment
Sourcepub fn next_doc_id(&self) -> u64
pub fn next_doc_id(&self) -> u64
Return the next document ID that will be assigned (without consuming it).
Sourcepub fn get_or_create_field_id(
&mut self,
collection_id: CollectionId,
path: &str,
) -> Result<FieldId, RegistryError>
pub fn get_or_create_field_id( &mut self, collection_id: CollectionId, path: &str, ) -> Result<FieldId, RegistryError>
Return or create a field ID for path.
Sourcepub fn get_or_create_doc_internal_id(
&mut self,
collection_id: CollectionId,
external_doc_id: &str,
) -> Result<DocId, RegistryError>
pub fn get_or_create_doc_internal_id( &mut self, collection_id: CollectionId, external_doc_id: &str, ) -> Result<DocId, RegistryError>
Return or create an internal document ID for external_doc_id.
Sourcepub fn field_path(&self, field_id: FieldId) -> Option<&str>
pub fn field_path(&self, field_id: FieldId) -> Option<&str>
Resolve field path by field ID.
Sourcepub fn doc_internal_id(&self, external_doc_id: &str) -> Option<DocId>
pub fn doc_internal_id(&self, external_doc_id: &str) -> Option<DocId>
Resolve internal document ID by external document ID.
Sourcepub fn doc_external_id(&self, doc_id: DocId) -> Option<&str>
pub fn doc_external_id(&self, doc_id: DocId) -> Option<&str>
Resolve external document ID by internal document ID.
Sourcepub fn field_count(&self) -> usize
pub fn field_count(&self) -> usize
Number of field IDs in this segment.
Sourcepub fn field_mappings(&self) -> Vec<(FieldId, String)>
pub fn field_mappings(&self) -> Vec<(FieldId, String)>
Return all field mappings as (field_id, field_path) sorted by field ID.
Trait Implementations§
Source§impl Debug for RegistrySegment
impl Debug for RegistrySegment
Source§impl Default for RegistrySegment
impl Default for RegistrySegment
Source§fn default() -> RegistrySegment
fn default() -> RegistrySegment
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RegistrySegment
impl RefUnwindSafe for RegistrySegment
impl Send for RegistrySegment
impl Sync for RegistrySegment
impl Unpin for RegistrySegment
impl UnsafeUnpin for RegistrySegment
impl UnwindSafe for RegistrySegment
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