pub trait ForgeMutation:
Send
+ Sync
+ 'static {
type Args: DeserializeOwned + Serialize + Send + Sync;
type Output: Serialize + Send;
// Required methods
fn info() -> FunctionInfo;
fn execute(
ctx: &MutationContext,
args: Self::Args,
) -> Pin<Box<dyn Future<Output = Result<Self::Output>> + Send + '_>>;
}Expand description
A mutation function (transactional write).
Mutations:
- Run within a database transaction
- Can read and write to the database
- Should NOT call external APIs (use Actions)
- Are atomic: all changes commit or none do
Required Associated Types§
Required Methods§
Sourcefn info() -> FunctionInfo
fn info() -> FunctionInfo
Function metadata.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.