pub struct SVCB<'a> {
pub priority: u16,
pub target: Name<'a>,
/* private fields */
}
Expand description
The SVCB DNS RR type is used to locate alternative endpoints for a service. RFC 9460.
Fields§
§priority: u16
The priority of this record (relative to others, with lower values preferred).
A value of 0 indicates AliasMode.
target: Name<'a>
The domain name of either the alias target (for AliasMode) or the alternative endpoint (for ServiceMode).
Implementations§
Source§impl<'a> SVCB<'a>
impl<'a> SVCB<'a>
Sourcepub fn new(priority: u16, target: Name<'a>) -> Self
pub fn new(priority: u16, target: Name<'a>) -> Self
Creates a new SVCB
instance with no parameters.
Sourcepub fn set_param(&mut self, param: SVCParam<'a>)
pub fn set_param(&mut self, param: SVCParam<'a>)
Sets a parameter, replacing any previous value.
Sourcepub fn with_param(self, param: SVCParam<'a>) -> Self
pub fn with_param(self, param: SVCParam<'a>) -> Self
Same as Self::set_param
, but returns self
for chaining.
Sourcepub fn set_mandatory(&mut self, keys: impl Iterator<Item = u16>)
pub fn set_mandatory(&mut self, keys: impl Iterator<Item = u16>)
Sets the “mandatory” parameter.
If keys
is empty, this method does nothing.
Sourcepub fn set_alpn(&mut self, alpn_ids: &[CharacterString<'a>])
pub fn set_alpn(&mut self, alpn_ids: &[CharacterString<'a>])
Sets the “alpn” parameter.
if alpn_ids
is empty, this method does nothing.
Sourcepub fn set_no_default_alpn(&mut self)
pub fn set_no_default_alpn(&mut self)
Sets the “no-default-alpn” parameter.
Sourcepub fn set_ipv4hint(&mut self, ips: &[u32])
pub fn set_ipv4hint(&mut self, ips: &[u32])
Sets the “ipv4hint” parameter.
if ips
is empty, this method does nothing.
Sourcepub fn set_ipv6hint(&mut self, ips: &[u128])
pub fn set_ipv6hint(&mut self, ips: &[u128])
Sets the “ipv6hint” parameter.
if ips
is empty, this method does nothing
Sourcepub fn get_param(&'a self, key: u16) -> Option<&'a SVCParam<'a>>
pub fn get_param(&'a self, key: u16) -> Option<&'a SVCParam<'a>>
Gets a read-only reference to the SVCParam
Returns None
if the key does not exist.
Sourcepub fn iter_params(&self) -> impl Iterator<Item = &SVCParam<'_>>
pub fn iter_params(&self) -> impl Iterator<Item = &SVCParam<'_>>
Iterates over all parameters.
Sourcepub fn into_owned<'b>(self) -> SVCB<'b>
pub fn into_owned<'b>(self) -> SVCB<'b>
Transforms the inner data into its owned type