nupp.io.uri.spi
Implementation interfaces consumed during ordinary module initialization. Discover with nupp.spi.load; the consumer chooses the unique highest priority. Omitted priority is zero. Importing these declarations loads no implementation.
Module contents
Types
| Type | Kind | Description |
|---|---|---|
Provider | interface | Absolute-URI parsing into canonical components, by the WHATWG URL Standard. |
UriParts | record | Normalized absolute-URI components shared by every parser. |
Types#
Providerinterface#
interface Provider ...Absolute-URI parsing into canonical components, by the WHATWG URL Standard.
Return nil and a diagnostic for unsupported or invalid input. Successful parses must make text, authority, host, port, and path mutually consistent and preserve absent versus empty query and fragment values.
UriPartsrecord#
record UriParts ...Normalized absolute-URI components shared by every parser.
Every parser reads text as the WHATWG URL Standard's basic URL parser does (https://url.spec.whatwg.org/), so text is the standard's serialization and each component is the standard's. A parser without IDNA refuses a special-scheme host that needs it rather than answering another host.
Use nil for an absent optional component and an empty string for a present empty one; an empty password is absent, as the standard drops it. The public URI wrapper uses this record without introducing a provider-specific nominal identity.
Members
| Name | Kind | Description |
|---|---|---|
text | field | Normalized complete URI text. |
scheme | field | Normalized scheme without the colon. |
authority | field | Serialized authority, or nil if the URI has none. |
username | field | Username component, empty when absent. |
password | field | Password component, or nil when absent or empty. |
host | field | Normalized host, or nil for a URI without one. |
port | field | Explicit non-default port when present. |
path | field | Normalized path component. |
query | field | Query without its question mark, or nil when absent. |
fragment | field | Fragment without its hash mark, or nil when absent. |