TResultStruct

A struct representing the result of a Thrift method call.

It contains a field called "success" for the return value of the function (with id 0), and additional fields for the exceptions declared for the method, if any.

There should usually be no reason to use this directly without the help of TServiceProcessor, but it is documented publicly to help debugging in case of CTFE errors.

Consider the following example:

interface Foo {
  int bar(string a);

  alias .FooException FooException;

  enum methodMeta = [
    TMethodMeta("bar",
      [TParamMeta("a", 1)],
      [TExceptionMeta("fooe", 1, "FooException")]
    )
  ];
}
alias TResultStruct!(Foo, "bar") FooBarResult;

The definition of FooBarResult is equivalent to:

struct FooBarResult {
  int success;
  FooException fooe;

  mixin(TStructHelpers!([TFieldMeta("success", 0, TReq.OPTIONAL),
    TFieldMeta("fooe", 1, TReq.OPTIONAL)]));
}

If the TVerboseCodegen version is defined, a warning message is issued at compilation if no TMethodMeta for Interface.methodName is found.

template TResultStruct (
Interface
string methodName
)

Meta