Construct an Id with RFC 8620 §1.2 syntax validation.
RFC 8620 §1.2 restricts Ids to the URL-safe base64 alphabet defined
in RFC 4648 §5, excluding the pad character =. The permitted
characters are therefore the ASCII alphanumerics (A-Z, a-z,
0-9), hyphen (-), and underscore (_). The string must also
be non-empty and at most 255 bytes.
Returns ValidationError when the input does not satisfy
RFC 8620 §1.2. The error description contains a category keyword
that callers can match on if they need finer-grained handling:
"empty" — the input was an empty string;
"exceeds 255 bytes" — the input was longer than the spec
maximum;
"invalid character" — the input contained at least one
character outside A-Z, a-z, 0-9, -, _.
Use Id::from when the value is known to be valid (e.g. a string
received from a JMAP server response).