pub struct ShardedRegistry { /* private fields */ }Expand description
Partition-hashed multi-shard registry (MVP: in-memory).
Implementations§
Source§impl ShardedRegistry
impl ShardedRegistry
Sourcepub fn shard_count(&self) -> usize
pub fn shard_count(&self) -> usize
Number of shards.
Sourcepub fn entry_count(&self) -> u64
pub fn entry_count(&self) -> u64
Total StrHash → raw entries across in-memory shards.
Sourcepub fn register(
&mut self,
hash: StrHash,
raw: impl Into<String>,
) -> Result<(), StorageError>
pub fn register( &mut self, hash: StrHash, raw: impl Into<String>, ) -> Result<(), StorageError>
Register a raw string on the shard selected by hash.
Sourcepub fn lookup(&self, hash: StrHash) -> Result<Option<String>, StorageError>
pub fn lookup(&self, hash: StrHash) -> Result<Option<String>, StorageError>
Look up a hash on the owning shard.
Sourcepub fn lookup_many(
&self,
hashes: &[StrHash],
) -> Result<Vec<Option<String>>, StorageError>
pub fn lookup_many( &self, hashes: &[StrHash], ) -> Result<Vec<Option<String>>, StorageError>
Positional bulk lookup (one HashMap get per hash).
Sourcepub fn register_quad(
&mut self,
quad: &Quad,
encoded: &EncodedQuad,
) -> Result<(), StorageError>
pub fn register_quad( &mut self, quad: &Quad, encoded: &EncodedQuad, ) -> Result<(), StorageError>
Register all hash-referenced strings required by an encoded quad.
encoded must be the same encoding the hexastore write path uses, so a
single insert encodes the quad once and shares it with the registry.
Trait Implementations§
Source§impl Clone for ShardedRegistry
impl Clone for ShardedRegistry
Source§fn clone(&self) -> ShardedRegistry
fn clone(&self) -> ShardedRegistry
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ShardedRegistry
impl RefUnwindSafe for ShardedRegistry
impl Send for ShardedRegistry
impl Sync for ShardedRegistry
impl Unpin for ShardedRegistry
impl UnsafeUnpin for ShardedRegistry
impl UnwindSafe for ShardedRegistry
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