of<T> static method
Resolves the codec for Dart type T.
Throws UnknownMessageTypeError if T has not been registered.
Implementation
static MessageCodec<T> of<T>() {
final codec = _byDartType[T];
if (codec == null) {
throw UnknownMessageTypeError('No codec registered for Dart type `$T`.');
}
return codec as MessageCodec<T>;
}