pub struct MutationRegistry { /* private fields */ }Expand description
变更注册表
注册类型到变更处理器的映射
Implementations§
Source§impl MutationRegistry
impl MutationRegistry
pub fn new() -> Self
Sourcepub fn register(
&self,
type_name: &str,
kind: MutationKind,
handler: MutationHandlerFn,
)
pub fn register( &self, type_name: &str, kind: MutationKind, handler: MutationHandlerFn, )
注册变更处理器
Sourcepub fn get(
&self,
type_name: &str,
kind: &MutationKind,
) -> Option<Arc<MutationHandlerFn>>
pub fn get( &self, type_name: &str, kind: &MutationKind, ) -> Option<Arc<MutationHandlerFn>>
查找变更处理器
Sourcepub fn execute(&self, input: &MutationInput) -> MutationResult
pub fn execute(&self, input: &MutationInput) -> MutationResult
执行变更
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for MutationRegistry
impl RefUnwindSafe for MutationRegistry
impl Send for MutationRegistry
impl Sync for MutationRegistry
impl Unpin for MutationRegistry
impl UnsafeUnpin for MutationRegistry
impl UnwindSafe for MutationRegistry
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