Interface IReasonMetadata

Namespace
REslava.Result
Assembly
REslava.Result.dll

Secondary capability interface for reasons that expose system/diagnostic metadata. Implement alongside IReason to opt-in to metadata support.

public interface IReasonMetadata
Extension Methods

Remarks

All built-in Reason subclasses implement this interface. External IReason implementations can also implement it to participate in diagnostic tooling, pipeline diagrams, and structured logging.

Use pattern matching to access metadata from IReason-typed references:

if (reason is IReasonMetadata m)
    Console.WriteLine(m.Metadata.CallerMember);

Or use the ergonomic extension method:

var caller = reason.TryGetMetadata()?.CallerMember;

Properties

Metadata

System/diagnostic metadata captured at the reason's creation site. Never null — defaults to Empty when no metadata is captured.

ReasonMetadata Metadata { get; }

Property Value

ReasonMetadata