pub struct InMemoryStore { /* private fields */ }Expand description
内存数据存储,支持 CRUD 操作
配合 MutationRegistry 使用,提供基本的创建/更新/删除能力
Implementations§
Source§impl InMemoryStore
impl InMemoryStore
pub fn new() -> Self
Sourcepub fn create(&self, type_name: &str, data: Value) -> MutationResult
pub fn create(&self, type_name: &str, data: Value) -> MutationResult
创建记录
Sourcepub fn delete(&self, type_name: &str, id: &str) -> MutationResult
pub fn delete(&self, type_name: &str, id: &str) -> MutationResult
删除记录
Sourcepub fn register_to(&self, type_name: &str, registry: &MutationRegistry)
pub fn register_to(&self, type_name: &str, registry: &MutationRegistry)
注册到 MutationRegistry
将此存储的 create/update/delete 方法注册为变更处理器
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for InMemoryStore
impl RefUnwindSafe for InMemoryStore
impl Send for InMemoryStore
impl Sync for InMemoryStore
impl Unpin for InMemoryStore
impl UnsafeUnpin for InMemoryStore
impl UnwindSafe for InMemoryStore
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