Struct Store

Source
pub struct Store { /* private fields */ }

Implementations§

Source§

impl Store

Source

pub fn new(snowflake: Arc<Snowflake>) -> Self

Source

pub fn create_entity( &mut self, ctx: &Context, entity_type: &EntityType, parent_id: Option<EntityId>, name: &str, ) -> Result<Entity>

Source

pub fn get_entity_schema( &self, _: &Context, entity_type: &EntityType, ) -> Result<EntitySchema<Single>>

Source

pub fn get_complete_entity_schema( &self, ctx: &Context, entity_type: &EntityType, ) -> Result<EntitySchema<Complete>>

Source

pub fn set_entity_schema( &mut self, ctx: &Context, entity_schema: &EntitySchema<Single>, ) -> Result<()>

Set or update the schema for an entity type

Source

pub fn get_field_schema( &self, ctx: &Context, entity_type: &EntityType, field_type: &FieldType, ) -> Result<FieldSchema>

Get the schema for a specific field

Source

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

Source

pub fn entity_exists(&self, _: &Context, entity_id: &EntityId) -> bool

Source

pub fn field_exists( &self, _: &Context, entity_type: &EntityType, field_type: &FieldType, ) -> bool

Source

pub fn perform( &mut self, ctx: &Context, requests: &mut Vec<Request>, ) -> Result<()>

Source

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

Source

pub fn find_entities( &self, _: &Context, entity_type: &EntityType, page_opts: Option<PageOpts>, ) -> Result<PageResult<EntityId>>

Find entities of a specific type with pagination

Source

pub fn get_entity_types( &self, _: &Context, page_opts: Option<PageOpts>, ) -> Result<PageResult<EntityType>>

Get all entity types with pagination

Source

pub fn take_snapshot(&self, _: &Context) -> Snapshot

Take a snapshot of the current store state

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.