pub struct MetadataStorage { /* private fields */ }Expand description
Type-aware metadata storage
Uses separate B-trees for each type, enabling:
- Efficient range queries on numeric types
- No NULL storage overhead
- Type-specific indexing
Implementations§
Source§impl MetadataStorage
impl MetadataStorage
Sourcepub fn set(
&mut self,
entity_id: EntityId,
key: impl Into<String>,
value: MetadataValue,
)
pub fn set( &mut self, entity_id: EntityId, key: impl Into<String>, value: MetadataValue, )
Set a metadata value for an entity
Sourcepub fn get(&self, entity_id: EntityId, key: &str) -> Option<MetadataValue>
pub fn get(&self, entity_id: EntityId, key: &str) -> Option<MetadataValue>
Get a metadata value for an entity
Sourcepub fn set_all(&mut self, entity_id: EntityId, metadata: &Metadata)
pub fn set_all(&mut self, entity_id: EntityId, metadata: &Metadata)
Set all metadata for an entity
Sourcepub fn remove_all(&mut self, entity_id: EntityId)
pub fn remove_all(&mut self, entity_id: EntityId)
Remove all metadata for an entity
Sourcepub fn filter_int_range(
&self,
key: &str,
min: Option<i64>,
max: Option<i64>,
) -> Vec<EntityId>
pub fn filter_int_range( &self, key: &str, min: Option<i64>, max: Option<i64>, ) -> Vec<EntityId>
Find entities matching int range
Sourcepub fn filter_string_prefix(&self, key: &str, prefix: &str) -> Vec<EntityId>
pub fn filter_string_prefix(&self, key: &str, prefix: &str) -> Vec<EntityId>
Find entities matching string prefix
Sourcepub fn filter_eq(&self, key: &str, value: &MetadataValue) -> Vec<EntityId>
pub fn filter_eq(&self, key: &str, value: &MetadataValue) -> Vec<EntityId>
Find entities where key equals value
Sourcepub fn entity_count(&self) -> usize
pub fn entity_count(&self) -> usize
Number of entities with metadata
Sourcepub fn value_count(&self) -> usize
pub fn value_count(&self) -> usize
Total number of key-value pairs
Trait Implementations§
Source§impl Debug for MetadataStorage
impl Debug for MetadataStorage
Source§impl Default for MetadataStorage
impl Default for MetadataStorage
Source§fn default() -> MetadataStorage
fn default() -> MetadataStorage
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MetadataStorage
impl RefUnwindSafe for MetadataStorage
impl Send for MetadataStorage
impl Sync for MetadataStorage
impl Unpin for MetadataStorage
impl UnsafeUnpin for MetadataStorage
impl UnwindSafe for MetadataStorage
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request