Skip to content
ModularityKit.Mutator ModularityKit.Mutator Docs
  • Home
  • Core
  • Governance
  • Redis
  • API
Search Results for

    Show / Hide Table of Contents

    Class MutationResult<TState>

    Represents the outcome of applying a mutation to a state. Always contains a trace of changes, even if the mutation fails.

    Inheritance
    object
    MutationResult<TState>
    Implements
    IEquatable<MutationResult<TState>>
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: ModularityKit.Mutator.Abstractions.Results
    Assembly: ModularityKit.Mutator.dll
    Syntax
    public sealed record MutationResult<TState> : IEquatable<MutationResult<TState>>
    Type Parameters
    Name Description
    TState

    The type of the state being mutated.

    Properties

    | Edit this page View Source

    Changes

    The set of changes describing what exactly was modified during the mutation. Always populated, even on failure.

    Declaration
    public ChangeSet Changes { get; init; }
    Property Value
    Type Description
    ChangeSet
    | Edit this page View Source

    CompletedAt

    Timestamp indicating when the mutation completed.

    Declaration
    public DateTimeOffset CompletedAt { get; init; }
    Property Value
    Type Description
    DateTimeOffset
    | Edit this page View Source

    Exception

    Exception thrown during mutation, if any, for diagnostic purposes.

    Declaration
    public Exception? Exception { get; init; }
    Property Value
    Type Description
    Exception
    | Edit this page View Source

    IsSuccess

    Indicates whether the mutation was successfully applied.

    Declaration
    public bool IsSuccess { get; init; }
    Property Value
    Type Description
    bool
    | Edit this page View Source

    Metrics

    Metrics related to the execution of the mutation (e.g., duration, performance counters).

    Declaration
    public MutationMetrics Metrics { get; init; }
    Property Value
    Type Description
    MutationMetrics
    | Edit this page View Source

    NewState

    The new state after mutation, if successful; otherwise null.

    Declaration
    public TState? NewState { get; init; }
    Property Value
    Type Description
    TState
    | Edit this page View Source

    PolicyDecisions

    Decisions from policy evaluation that influenced the mutation outcome.

    Declaration
    public IReadOnlyList<PolicyDecision> PolicyDecisions { get; init; }
    Property Value
    Type Description
    IReadOnlyList<PolicyDecision>
    | Edit this page View Source

    SideEffects

    Side effects produced during the mutation.

    Declaration
    public IReadOnlyList<SideEffect> SideEffects { get; init; }
    Property Value
    Type Description
    IReadOnlyList<SideEffect>
    | Edit this page View Source

    ValidationResult

    Result of validation checks performed during mutation.

    Declaration
    public ValidationResult ValidationResult { get; init; }
    Property Value
    Type Description
    ValidationResult

    Methods

    | Edit this page View Source

    Failure(ValidationResult)

    Creates a failed mutation result due to validation errors.

    Declaration
    public static MutationResult<TState> Failure(ValidationResult validation)
    Parameters
    Type Name Description
    ValidationResult validation

    The validation result explaining the failure.

    Returns
    Type Description
    MutationResult<TState>

    A MutationResult<TState> representing failure.

    | Edit this page View Source

    PolicyBlocked(PolicyDecision)

    Creates a failed mutation result due to policy enforcement.

    Declaration
    public static MutationResult<TState> PolicyBlocked(PolicyDecision decision)
    Parameters
    Type Name Description
    PolicyDecision decision

    The policy decision that blocked the mutation.

    Returns
    Type Description
    MutationResult<TState>

    A MutationResult<TState> representing a policy-blocked mutation.

    | Edit this page View Source

    Success(TState, ChangeSet, IReadOnlyList<SideEffect>?)

    Creates a successful mutation result.

    Declaration
    public static MutationResult<TState> Success(TState newState, ChangeSet changes, IReadOnlyList<SideEffect>? sideEffects = null)
    Parameters
    Type Name Description
    TState newState

    The new state after the mutation.

    ChangeSet changes

    The set of changes applied.

    IReadOnlyList<SideEffect> sideEffects

    Optional list of side effects.

    Returns
    Type Description
    MutationResult<TState>

    A MutationResult<TState> representing success.

    | Edit this page View Source

    Success(TState, StateChange, IReadOnlyList<SideEffect>?)

    Creates a successful mutation result from a single state change.

    Declaration
    public static MutationResult<TState> Success(TState newState, StateChange change, IReadOnlyList<SideEffect>? sideEffects = null)
    Parameters
    Type Name Description
    TState newState

    The new state after the mutation.

    StateChange change

    The single change applied.

    IReadOnlyList<SideEffect> sideEffects

    Optional list of side effects.

    Returns
    Type Description
    MutationResult<TState>

    A MutationResult<TState> representing success.

    Implements

    IEquatable<T>
    • Edit this page
    • View Source
    In this article
    ModularityKit.Mutator Generated from XML docs and published from main. Back to top