pub struct Store { /* private fields */ }Implementations§
Source§impl Store
impl Store
pub fn new(snowflake: Arc<Snowflake>) -> Self
pub fn create_entity( &mut self, ctx: &Context, entity_type: &EntityType, parent_id: Option<EntityId>, name: &str, ) -> Result<Entity>
pub fn get_entity_schema( &self, _: &Context, entity_type: &EntityType, ) -> Result<EntitySchema<Single>>
pub fn get_complete_entity_schema( &self, ctx: &Context, entity_type: &EntityType, ) -> Result<EntitySchema<Complete>>
Sourcepub fn set_entity_schema(
&mut self,
ctx: &Context,
entity_schema: &EntitySchema<Single>,
) -> Result<()>
pub fn set_entity_schema( &mut self, ctx: &Context, entity_schema: &EntitySchema<Single>, ) -> Result<()>
Set or update the schema for an entity type
Sourcepub fn get_field_schema(
&self,
ctx: &Context,
entity_type: &EntityType,
field_type: &FieldType,
) -> Result<FieldSchema>
pub fn get_field_schema( &self, ctx: &Context, entity_type: &EntityType, field_type: &FieldType, ) -> Result<FieldSchema>
Get the schema for a specific field
Sourcepub fn set_field_schema(
&mut self,
ctx: &Context,
entity_type: &EntityType,
field_type: &FieldType,
field_schema: FieldSchema,
) -> Result<()>
pub fn set_field_schema( &mut self, ctx: &Context, entity_type: &EntityType, field_type: &FieldType, field_schema: FieldSchema, ) -> Result<()>
Set or update the schema for a specific field
pub fn entity_exists(&self, _: &Context, entity_id: &EntityId) -> bool
pub fn field_exists( &self, _: &Context, entity_type: &EntityType, field_type: &FieldType, ) -> bool
pub fn perform( &mut self, ctx: &Context, requests: &mut Vec<Request>, ) -> Result<()>
Sourcepub fn delete_entity(
&mut self,
ctx: &Context,
entity_id: &EntityId,
) -> Result<()>
pub fn delete_entity( &mut self, ctx: &Context, entity_id: &EntityId, ) -> Result<()>
Deletes an entity and all its fields Returns an error if the entity doesn’t exist
Sourcepub fn find_entities(
&self,
_: &Context,
entity_type: &EntityType,
page_opts: Option<PageOpts>,
) -> Result<PageResult<EntityId>>
pub fn find_entities( &self, _: &Context, entity_type: &EntityType, page_opts: Option<PageOpts>, ) -> Result<PageResult<EntityId>>
Find entities of a specific type with pagination
Sourcepub fn get_entity_types(
&self,
_: &Context,
page_opts: Option<PageOpts>,
) -> Result<PageResult<EntityType>>
pub fn get_entity_types( &self, _: &Context, page_opts: Option<PageOpts>, ) -> Result<PageResult<EntityType>>
Get all entity types with pagination
Sourcepub fn take_snapshot(&self, _: &Context) -> Snapshot
pub fn take_snapshot(&self, _: &Context) -> Snapshot
Take a snapshot of the current store state
Sourcepub fn restore_snapshot(&mut self, _: &Context, snapshot: Snapshot)
pub fn restore_snapshot(&mut self, _: &Context, snapshot: Snapshot)
Restore the store state from a snapshot
Auto Trait Implementations§
impl Freeze for Store
impl RefUnwindSafe for Store
impl Send for Store
impl Sync for Store
impl Unpin for Store
impl UnwindSafe for Store
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