pub struct HTTPS<'a>(pub SVCB<'a>);
Expand description
Tuple Fields§
§0: SVCB<'a>
Implementations§
Methods from Deref<Target = SVCB<'a>>§
pub const MANDATORY: u16 = 0u16
pub const ALPN: u16 = 1u16
pub const NO_DEFAULT_ALPN: u16 = 2u16
pub const PORT: u16 = 3u16
pub const IPV4HINT: u16 = 4u16
pub const ECH: u16 = 5u16
pub const IPV6HINT: u16 = 6u16
sourcepub fn set_param<V: Into<Cow<'a, [u8]>>>(
&mut self,
key: u16,
value: V,
) -> Result<()>
pub fn set_param<V: Into<Cow<'a, [u8]>>>( &mut self, key: u16, value: V, ) -> Result<()>
Sets an arbitrary key=value parameter.
The format of value
is not checked against the key
.
If a parameter of the given key
already existed, the previous entry will be replaced.
sourcepub fn set_mandatory<I: IntoIterator<Item = u16>>(
&mut self,
keys: I,
) -> Result<()>
pub fn set_mandatory<I: IntoIterator<Item = u16>>( &mut self, keys: I, ) -> Result<()>
Sets the “mandatory” parameter.
The keys
MUST not be empty and already in strictly increasing order.
sourcepub fn set_alpn<'cs, I: IntoIterator<Item = CharacterString<'cs>>>(
&mut self,
alpn_ids: I,
) -> Result<()>
pub fn set_alpn<'cs, I: IntoIterator<Item = CharacterString<'cs>>>( &mut self, alpn_ids: I, ) -> Result<()>
Sets the “alpn” parameter.
The alpn_ids
MUST not be empty.
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<I: IntoIterator<Item = u32>>(
&mut self,
ips: I,
) -> Result<()>
pub fn set_ipv4hint<I: IntoIterator<Item = u32>>( &mut self, ips: I, ) -> Result<()>
Sets the “ipv4hint” parameter.
The ips
MUST not be empty.
sourcepub fn set_ipv6hint<I: IntoIterator<Item = u128>>(
&mut self,
ips: I,
) -> Result<()>
pub fn set_ipv6hint<I: IntoIterator<Item = u128>>( &mut self, ips: I, ) -> Result<()>
Sets the “ipv6hint” parameter.
The ips
MUST not be empty.
sourcepub fn get_param(&self, key: u16) -> Option<&[u8]>
pub fn get_param(&self, key: u16) -> Option<&[u8]>
Gets a read-only reference to the SvcParamValue of a given key in wire format.
Returns None
if the key does not exist.
sourcepub fn iter_params(&self) -> impl Iterator<Item = (u16, &[u8])>
pub fn iter_params(&self) -> impl Iterator<Item = (u16, &[u8])>
Iterates over all parameters.
Trait Implementations§
impl<'a> Eq for HTTPS<'a>
impl<'a> StructuralPartialEq for HTTPS<'a>
Auto Trait Implementations§
impl<'a> Freeze for HTTPS<'a>
impl<'a> RefUnwindSafe for HTTPS<'a>
impl<'a> Send for HTTPS<'a>
impl<'a> Sync for HTTPS<'a>
impl<'a> Unpin for HTTPS<'a>
impl<'a> UnwindSafe for HTTPS<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)