pub struct MutatorDefinition<A, C, O = ()> {
pub name: &'static str,
/* private fields */
}Expand description
A named mutator (defineMutator): A is its arguments, C the
client’s context, and O what its optimistic run returns to the
caller’s client outcome (() for nothing). Make one with
define_mutator.
The name must match the TS registry entry the API server runs. The body
runs once optimistically and again on every rebase while the mutation is
pending, so it must only depend on tx, the arguments, and the context.
Fields§
§name: &'static strIts name in the TS mutator registry.
Implementations§
Source§impl<A, C, O> MutatorDefinition<A, C, O>
impl<A, C, O> MutatorDefinition<A, C, O>
Sourcepub fn with(&self, args: A) -> MutateRequest
pub fn with(&self, args: A) -> MutateRequest
The mutation of this mutator with args, for
Zero::mutate_request.
Sourcepub fn mutator(&self) -> Mutator<C>
pub fn mutator(&self) -> Mutator<C>
The mutator to register with Zero::new, so the client runs it and
replays it by name. Arguments that don’t read as A fail it with
an ApplicationError.
Trait Implementations§
Source§impl<A, C, O> Clone for MutatorDefinition<A, C, O>
impl<A, C, O> Clone for MutatorDefinition<A, C, O>
impl<A, C, O> Copy for MutatorDefinition<A, C, O>
Source§impl<A, C, O> NamedMutator<C> for MutatorDefinition<A, C, O>
impl<A, C, O> NamedMutator<C> for MutatorDefinition<A, C, O>
Auto Trait Implementations§
impl<A, C, O> Forget for MutatorDefinition<A, C, O>
impl<A, C, O> Freeze for MutatorDefinition<A, C, O>
impl<A, C, O> Move for MutatorDefinition<A, C, O>
impl<A, C, O> RefUnwindSafe for MutatorDefinition<A, C, O>
impl<A, C, O> Send for MutatorDefinition<A, C, O>
impl<A, C, O> Sync for MutatorDefinition<A, C, O>
impl<A, C, O> Unpin for MutatorDefinition<A, C, O>
impl<A, C, O> UnsafeUnpin for MutatorDefinition<A, C, O>
impl<A, C, O> UnwindSafe for MutatorDefinition<A, C, O>
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