mirror of
https://github.com/FabInfra/capnproto-dotnetcore_Runtime.git
synced 2025-03-12 23:01:44 +01:00
29 lines
773 B
C#
29 lines
773 B
C#
namespace Capnp.Rpc
|
|
{
|
|
/// <summary>
|
|
/// Helper struct to support tail calls
|
|
/// </summary>
|
|
public struct AnswerOrCounterquestion
|
|
{
|
|
readonly object _obj;
|
|
|
|
AnswerOrCounterquestion(object obj)
|
|
{
|
|
_obj = obj;
|
|
}
|
|
|
|
public static implicit operator AnswerOrCounterquestion (SerializerState answer)
|
|
{
|
|
return new AnswerOrCounterquestion(answer);
|
|
}
|
|
|
|
public static implicit operator AnswerOrCounterquestion (PendingQuestion counterquestion)
|
|
{
|
|
return new AnswerOrCounterquestion(counterquestion);
|
|
}
|
|
|
|
public SerializerState Answer => _obj as SerializerState;
|
|
public PendingQuestion Counterquestion => _obj as PendingQuestion;
|
|
}
|
|
}
|