# `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.
## Types
### `Provider` _interface_
```nupp
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.
#### Members
| Name | Kind | Description |
| --- | --- | --- |
| [`priority`](#nupp.io.uri.spi.Provider.priority) | field | |
| [`parse`](#nupp.io.uri.spi.Provider.parse) | method | Parses an absolute URI into shared components or returns nil and a message. |
#### `priority` _field_
```nupp
priority: integer?
```
`@readonly`
#### `parse` _method_
```nupp
parse: function(text: string): (UriParts?, string?)
```
`@readonly`
Parses an absolute URI into shared components or returns nil and a message.
##### Arguments
| Name | Type | Description |
| --- | --- | --- |
| `text` | `string` | |
##### Returns
| Type | Description |
| --- | --- |
| `UriParts?` | |
| `string?` | |
### `UriParts` _record_
```nupp
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`](#nupp.io.uri.spi.UriParts.text) | field | Normalized complete URI text. |
| [`scheme`](#nupp.io.uri.spi.UriParts.scheme) | field | Normalized scheme without the colon. |
| [`authority`](#nupp.io.uri.spi.UriParts.authority) | field | Serialized authority, or nil if the URI has none. |
| [`username`](#nupp.io.uri.spi.UriParts.username) | field | Username component, empty when absent. |
| [`password`](#nupp.io.uri.spi.UriParts.password) | field | Password component, or nil when absent or empty. |
| [`host`](#nupp.io.uri.spi.UriParts.host) | field | Normalized host, or nil for a URI without one. |
| [`port`](#nupp.io.uri.spi.UriParts.port) | field | Explicit non-default port when present. |
| [`path`](#nupp.io.uri.spi.UriParts.path) | field | Normalized path component. |
| [`query`](#nupp.io.uri.spi.UriParts.query) | field | Query without its question mark, or nil when absent. |
| [`fragment`](#nupp.io.uri.spi.UriParts.fragment) | field | Fragment without its hash mark, or nil when absent. |
#### `text` _field_
```nupp
text: string
```
Normalized complete URI text.
#### `scheme` _field_
```nupp
scheme: string
```
Normalized scheme without the colon.
#### `authority` _field_
```nupp
authority: string?
```
Serialized authority, or nil if the URI has none.
#### `username` _field_
```nupp
username: string
```
Username component, empty when absent.
#### `password` _field_
```nupp
password: string?
```
Password component, or nil when absent or empty.
#### `host` _field_
```nupp
host: string?
```
Normalized host, or nil for a URI without one.
#### `port` _field_
```nupp
port: integer?
```
Explicit non-default port when present.
#### `path` _field_
```nupp
path: string
```
Normalized path component.
#### `query` _field_
```nupp
query: string?
```
Query without its question mark, or nil when absent.
#### `fragment` _field_
```nupp
fragment: string?
```
Fragment without its hash mark, or nil when absent.