Time.fromString constructor

Time.fromString(
  1. String v
)

Creates a new Time from an IXDTF string.

See the Rust documentation for try_from_str for more information.

Throws Rfc9557ParseError on failure.

Implementation

factory Time.fromString(String v) {
  final temp = _FinalizedArena();
  final result = _icu4x_Time_from_string_mv1(v._utf8AllocIn(temp.arena));
  if (!result.isOk) {
    throw Rfc9557ParseError.values[result.union.err];
  }
  return Time._fromFfi(result.union.ok, []);
}