A format specifier.
A FormatSpec with the specifier parsed.
A FormatException when more than one specifier is given or the specifier is malformed.
import std.exception : assertThrown; auto spec = singleSpec("%2.3e"); assert(spec.trailing == ""); assert(spec.spec == 'e'); assert(spec.width == 2); assert(spec.precision == 3); assertThrown!FormatException(singleSpec("")); assertThrown!FormatException(singleSpec("2.3e")); assertThrown!FormatException(singleSpec("%2.3eTest"));
Helper function that returns a FormatSpec for a single specifier given in fmt.