Skip to main content

Module endpoint

Module endpoint 

Source

Enumsยง

Addr
Addr defines a type for an address, either IP or domain.
Endpoint
Endpoint defines generic network endpoints for karyon.

Constantsยง

DNS_TIMEOUT ๐Ÿ”’
Max time to wait for a DNS lookup.

Traitsยง

ToEndpoint

Functionsยง

resolve ๐Ÿ”’
Resolve an Addr + port to a SocketAddr. Domains are resolved through the system DNS with the given port.
resolve_endpoint ๐Ÿ”’
Async version of SocketAddr::try_from(endpoint). Domains are resolved on a blocking thread pool under a timeout, so DNS never blocks the executor.
url_to_addr ๐Ÿ”’
write_addr ๐Ÿ”’
Writes scheme://addr:port. An IPv6 address goes inside brackets, so the output parses back to the same endpoint.

Type Aliasesยง

Port
Port defined as a u16.