marshalForCodec static method

Uint8List marshalForCodec(
  1. bool structCodec,
  2. Marshaler msg
)

Marshal msg with the codec selected for a call (struct layout when negotiated).

Implementation

static Uint8List marshalForCodec(bool structCodec, Marshaler msg) {
  if (structCodec) {
    if (msg is StructMarshaler) {
      return (msg as StructMarshaler).marshalStruct();
    }
    throw StatusException(Wire.codeInternal, 'message has no struct codec');
  }
  return msg.marshalDc();
}