scalar<E, R extends RType> method

StructValueField<E, R> scalar<E, R extends RType>(
  1. F f
)

Creates a scalar value field for f.

f must describe a scalar-compatible RType.

Implementation

StructValueField<E, R> scalar<E, R extends RType>(F f) {
  _checkField(f);
  final type = _getFieldAs<R>(f);
  return .new(offset(f), ScalarCodec(type));
}