| Copyright | (c) Viktor Dukhovni 2026 |
|---|---|
| License | BSD-3-Clause |
| Maintainer | ietf-dane@dukhovni.org |
| Stability | unstable |
| Safe Haskell | None |
| Language | GHC2024 |
Net.DNSBase.Text
Description
Newtype wrappers that tag a byte string with a particular
text-shaped presentation form: DnsText renders an opaque
byte sequence as a DNS character-string with the standard
\DDD escaping for non-printable bytes, and DnsUtf8Text
renders a UTF-8 Text value with the same escape rules. The
presentCharString, presentDomainLabel, and
presentHostLabel helpers handle the per-context escape sets
(character-strings, domain labels, and the stricter hostname
form respectively). presentCSVList formats a comma-separated
list value as used by multi-valued SVCB parameters.
Synopsis
- newtype DnsText = DnsText ShortByteString
- newtype DnsUtf8Text = DnsUtf8Text Text
- dnsTextCmp :: Coercible a ShortByteString => a -> a -> Ordering
- presentCharString :: ShortByteString -> Builder -> Builder
- presentDomainLabel :: Word8 -> ByteString -> Builder -> Builder
- presentHostLabel :: Word8 -> ByteString -> Builder -> Builder
- presentCSVList :: [ShortByteString] -> Builder -> Builder
Documentation
Constructors
| DnsText ShortByteString | Character string |
Instances
| Presentable DnsText Source # | |
Defined in Net.DNSBase.Internal.Text Methods present :: DnsText -> Builder -> Builder Source # presentLazy :: DnsText -> ByteString -> ByteString Source # | |
| Show DnsText Source # | |
| Eq DnsText Source # | |
| Ord DnsText Source # | Canonical wire-form comparison of DNS character strings. |
Defined in Net.DNSBase.Internal.Text | |
newtype DnsUtf8Text Source #
Supports UTF8 character strings, which are presented like all other character strings, but must be valid UTF8 on the wire, and when unescaped from presentation form.
Constructors
| DnsUtf8Text Text |
Instances
| Presentable DnsUtf8Text Source # | |
Defined in Net.DNSBase.Internal.Text Methods present :: DnsUtf8Text -> Builder -> Builder Source # presentLazy :: DnsUtf8Text -> ByteString -> ByteString Source # | |
| Show DnsUtf8Text Source # | |
Defined in Net.DNSBase.Internal.Text Methods showsPrec :: Int -> DnsUtf8Text -> ShowS # show :: DnsUtf8Text -> String # showList :: [DnsUtf8Text] -> ShowS # | |
| Eq DnsUtf8Text Source # | |
Defined in Net.DNSBase.Internal.Text | |
| Ord DnsUtf8Text Source # | |
Defined in Net.DNSBase.Internal.Text Methods compare :: DnsUtf8Text -> DnsUtf8Text -> Ordering # (<) :: DnsUtf8Text -> DnsUtf8Text -> Bool # (<=) :: DnsUtf8Text -> DnsUtf8Text -> Bool # (>) :: DnsUtf8Text -> DnsUtf8Text -> Bool # (>=) :: DnsUtf8Text -> DnsUtf8Text -> Bool # max :: DnsUtf8Text -> DnsUtf8Text -> DnsUtf8Text # min :: DnsUtf8Text -> DnsUtf8Text -> DnsUtf8Text # | |
dnsTextCmp :: Coercible a ShortByteString => a -> a -> Ordering Source #
Compare wire-form character-strings, by length first.
Arguments
| :: ShortByteString | The bytes to encode. |
| -> Builder | Continuation |
| -> Builder |
Present a dns character-string with the given continuation. The result is enclosed in double-quotes.
Arguments
| :: Word8 | Label separator, typically 0x2e ( |
| -> ByteString | The bytes to encode. |
| -> Builder | Continuation |
| -> Builder |
Present a Domain label with the given continuation.
Arguments
| :: Word8 | Label separator, typically 0x2e ( |
| -> ByteString | The bytes to encode. |
| -> Builder | Continuation |
| -> Builder |
Present a Host label folded to lower case, with the given continuation.
Arguments
| :: [ShortByteString] | The elements to encode. |
| -> Builder | Continuation |
| -> Builder |
Present a Host label folded to lower case, with the given continuation.