pub const RIDL_STD_SOURCE: &str = "package ridl.std\n\n// ---------- Regex Constants ----------\n\n/// Pattern of a UUID: five groups of 8, 4, 4, 4 and 12 lowercase hexadecimal digits\nconst UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/\n/// Pattern of a ULID: 26 Crockford base32 characters, the first one 0 to 7\nconst ULID_PATTERN = /^[0-7][0-9A-HJKMNP-TV-Z]{25}$/\n/// Pattern of a URI: a scheme, `://`, then at least one character\nconst URI_PATTERN = /^[a-zA-Z][a-zA-Z0-9+\\-.]*:\\/\\/.+$/\n/// Pattern of a URL: `http://` or `https://`, then at least one character\nconst URL_PATTERN = /^https?:\\/\\/.+$/\n/// Pattern of an email address: a local part, `@`, and a domain that contains a dot\nconst EMAIL_PATTERN = /^[^@]+@[^@]+\\.[^@]+$/\n/// Pattern of an IPv4 address: four groups of 1 to 3 digits, separated by dots\nconst IPV4_PATTERN = /^(\\d{1,3}\\.){3}\\d{1,3}$/\n/// Pattern of an IPv6 address: lowercase hexadecimal digits and colons\nconst IPV6_PATTERN = /^[0-9a-f:]+$/\n/// Pattern of a string of printable ASCII characters\nconst ASCII_PATTERN = /^[\\x20-\\x7E]+$/\n\n// ---------- Identity Types ----------\n\n/// RFC 4122 UUID \u{2014} 36 characters including hyphens\ntype Uuid : string [36 match UUID_PATTERN]\n\n/// ULID \u{2014} 26 characters, lexicographically sortable\ntype Ulid : string [26 match ULID_PATTERN]\n\n// ---------- Network Types ----------\n\n/// RFC 3986 URI\ntype Uri : string [1..2048 match URI_PATTERN]\n\n/// HTTP/HTTPS URL\ntype Url : string [1..2048 match URL_PATTERN]\n\n/// Email address \u{2014} RFC 5321\ntype Email : string [1..254 match EMAIL_PATTERN]\n\n/// IPv4 address \u{2014} dotted decimal notation\ntype IpV4 : string [7..15 match IPV4_PATTERN]\n\n/// IPv6 address\ntype IpV6 : string [2..39 match IPV6_PATTERN]\n\n// ---------- General String Types ----------\n\n/// Short human-readable label \u{2014} ASCII printable, max 64 characters\ntype Label : string [1..64 match ASCII_PATTERN]\n\n/// Human-readable name \u{2014} max 128 characters\ntype Name : string [1..128 match ASCII_PATTERN]\n\n/// Short message or description \u{2014} max 256 characters\ntype Message : string [1..256 match ASCII_PATTERN]\n\n// ---------- Time Types ----------\n\n/// Absolute point in time \u{2014} platform time domain (ridl \u{a7}3.1):\n/// int64 microseconds since the PTP epoch, 1970-01-01 00:00:00 TAI.\n/// Continuous and leap-second-free; convert to civil datetime only at\n/// presentation edges.\ntype Timestamp : integer [0..9223372036854775807]\n\n/// Elapsed time interval in milliseconds\ntype Duration : ms [0.0..9223372036854775807]\n\n/// Calendar date \u{2014} ISO 8601 YYYY-MM-DD\ntype Date : string [10 match /^\\d{4}-\\d{2}-\\d{2}$/]\n\n/// Time of day \u{2014} ISO 8601 HH:MM:SS\ntype TimeOfDay : string [8..15 match /^\\d{2}:\\d{2}:\\d{2}/]\n\n// ---------- Version ----------\n\n/// Semantic version \u{2014} SemVer 2.0.0\ntype Version : string [5..32 match /^\\d+\\.\\d+\\.\\d+/]\n\n// ---------- Locale ----------\n\n/// ISO 3166-1 alpha-2 country code\ntype CountryCode : string [2 match /^[A-Z]{2}$/]\n\n/// ISO 639-1 language code with optional region \u{2014} e.g. \"en\", \"en-US\"\ntype LanguageCode : string [2..5 match /^[a-z]{2}(-[A-Z]{2})?$/]\n\n// ---------- Crypto / Security ----------\n\n/// SHA-256 hash \u{2014} 32 bytes\ntype Sha256Hash : bytes [32]\n\n/// SHA-512 hash \u{2014} 64 bytes\ntype Sha512Hash : bytes [64]\n\n/// Generic cryptographic signature \u{2014} 64 bytes\ntype Signature : bytes [64]\n\n/// X.509 DER certificate\ntype Certificate : bytes [1..4096]\n";Expand description
The ridl.std source, verbatim from the typl reference Appendix A.