Struct ExternalCallDecision
What an IExternalCallInterceptor decided about a call: let it through, refuse it, or answer it.
public readonly record struct ExternalCallDecision : IEquatable<ExternalCallDecision>
- Implements
- Inherited Members
Constructors
ExternalCallDecision(string?, ExternalCallAnswer?)
What an IExternalCallInterceptor decided about a call: let it through, refuse it, or answer it.
public ExternalCallDecision(string? Reason, ExternalCallAnswer? Answer = null)
Parameters
ReasonstringWhy the call was refused, in words a person reading a diagnostic needs: null when it was not refused.
AnswerExternalCallAnswerWhat the call yields in place of running it: null when it was not answered.
Properties
Allow
Let the call through.
public static ExternalCallDecision Allow { get; }
Property Value
Answer
What the call yields in place of running it: null when it was not answered.
public ExternalCallAnswer? Answer { get; init; }
Property Value
IsAnswered
Whether the call was answered (Answer), and is not to be run.
public bool IsAnswered { get; }
Property Value
IsBlocked
Whether the call was refused.
public bool IsBlocked { get; }
Property Value
Reason
Why the call was refused, in words a person reading a diagnostic needs: null when it was not refused.
public string? Reason { get; init; }
Property Value
Methods
Answered(ExternalCallAnswer)
Answer the call: it is not run, and the call site gets answer as though the member had
returned it.
public static ExternalCallDecision Answered(ExternalCallAnswer answer)
Parameters
answerExternalCallAnswerWhat the call yields: a result or an error, and the
ByRefarguments it writes.
Returns
Block(string)
Refuse the call.
public static ExternalCallDecision Block(string reason)
Parameters
reasonstringWhy: it reaches the workspace as the verbose half of a
Permission deniedrun-time error, so it should say what was refused and on what grounds.