pub trait EntityStore:
Send
+ Sync
+ 'static {
// Required methods
fn upsert_entity<'life0, 'async_trait>(
&'life0 self,
entity: Entity,
) -> Pin<Box<dyn Future<Output = StorageResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn upsert_entities<'life0, 'async_trait>(
&'life0 self,
entities: Vec<Entity>,
) -> Pin<Box<dyn Future<Output = StorageResult<BatchWriteSummary>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_entity<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = StorageResult<Option<Entity>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn delete_entity<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
mode: DeleteMode,
) -> Pin<Box<dyn Future<Output = StorageResult<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn query_entities<'life0, 'life1, 'async_trait>(
&'life0 self,
namespace: &'life1 str,
filter: EntityFilter,
page: PageRequest,
) -> Pin<Box<dyn Future<Output = StorageResult<Page<Entity>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn count_entities<'life0, 'life1, 'async_trait>(
&'life0 self,
namespace: &'life1 str,
filter: EntityFilter,
) -> Pin<Box<dyn Future<Output = StorageResult<u64>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Entity CRUD operations over the entities substrate table.
Required Methods§
Sourcefn upsert_entity<'life0, 'async_trait>(
&'life0 self,
entity: Entity,
) -> Pin<Box<dyn Future<Output = StorageResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn upsert_entity<'life0, 'async_trait>(
&'life0 self,
entity: Entity,
) -> Pin<Box<dyn Future<Output = StorageResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Insert or update a single entity.
Sourcefn upsert_entities<'life0, 'async_trait>(
&'life0 self,
entities: Vec<Entity>,
) -> Pin<Box<dyn Future<Output = StorageResult<BatchWriteSummary>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn upsert_entities<'life0, 'async_trait>(
&'life0 self,
entities: Vec<Entity>,
) -> Pin<Box<dyn Future<Output = StorageResult<BatchWriteSummary>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Insert or update a batch of entities.
Sourcefn get_entity<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = StorageResult<Option<Entity>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_entity<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = StorageResult<Option<Entity>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetch an entity by UUID, returning None if absent.
Sourcefn delete_entity<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
mode: DeleteMode,
) -> Pin<Box<dyn Future<Output = StorageResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete_entity<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
mode: DeleteMode,
) -> Pin<Box<dyn Future<Output = StorageResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Delete an entity by UUID using the specified delete mode.
Sourcefn query_entities<'life0, 'life1, 'async_trait>(
&'life0 self,
namespace: &'life1 str,
filter: EntityFilter,
page: PageRequest,
) -> Pin<Box<dyn Future<Output = StorageResult<Page<Entity>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn query_entities<'life0, 'life1, 'async_trait>(
&'life0 self,
namespace: &'life1 str,
filter: EntityFilter,
page: PageRequest,
) -> Pin<Box<dyn Future<Output = StorageResult<Page<Entity>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Query entities by namespace with filter and pagination.
Sourcefn count_entities<'life0, 'life1, 'async_trait>(
&'life0 self,
namespace: &'life1 str,
filter: EntityFilter,
) -> Pin<Box<dyn Future<Output = StorageResult<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn count_entities<'life0, 'life1, 'async_trait>(
&'life0 self,
namespace: &'life1 str,
filter: EntityFilter,
) -> Pin<Box<dyn Future<Output = StorageResult<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Count entities in a namespace matching the given filter.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".