pub struct Alpn<Octs: ?Sized>(/* private fields */);
Expand description
The application layer protocols supported by the service endpoint.
This value lists the protocol names supported by the service endpoint
described by the service binding’s target name and, if present, port.
The names are the same as used by Application Layer Protocol
Negotiation (ALPN) described in [RFC 7301]. Each scheme that uses
service bindings defines a set of default protocols that are quietly
added to this list unless the NoDefaultAlpn
value is present as
well. For HTTPS, this default set consists of the "http/1.1"
protocol.
The wire format of this value consists of those protocol names each
preceeded by a u8
giving their length.
The iter
method produces an iterator over the individual protocol
names in the value.
Implementations§
source§impl<Octs> Alpn<Octs>
impl<Octs> Alpn<Octs>
sourcepub unsafe fn from_octets_unchecked(octets: Octs) -> Self
pub unsafe fn from_octets_unchecked(octets: Octs) -> Self
Creates a new value from octets without checking.
§Safety
The caller has to ensure that octets
contains a properly
formated value of at most 65,535 octets.
source§impl Alpn<[u8]>
impl Alpn<[u8]>
sourcepub unsafe fn from_slice_unchecked(slice: &[u8]) -> &Self
pub unsafe fn from_slice_unchecked(slice: &[u8]) -> &Self
Creates a new value for a slice without checking.
§Safety
The caller has to ensure that slice
contains a properly
formated value of at most 65,535 octets.
source§impl<Octs: AsRef<[u8]>> Alpn<Octs>
impl<Octs: AsRef<[u8]>> Alpn<Octs>
sourcepub fn from_octets(octets: Octs) -> Result<Self, ParseError>
pub fn from_octets(octets: Octs) -> Result<Self, ParseError>
Creates an ALPN value from the underlying octets.
The function ensures that octets
is a correctly encoded ALPN
value. It does not, however, check that the protocol identifiers
are valid.
source§impl Alpn<[u8]>
impl Alpn<[u8]>
sourcepub fn from_slice(slice: &[u8]) -> Result<&Self, ParseError>
pub fn from_slice(slice: &[u8]) -> Result<&Self, ParseError>
Creates an ALPN value from an octets slice.
The function ensures that slice
is a correctly encoded ALPN
value. It does not, however, check that the protocol identifiers
are valid.
Trait Implementations§
source§impl<Octs: AsRef<[u8]> + ?Sized> ComposeSvcParamValue for Alpn<Octs>
impl<Octs: AsRef<[u8]> + ?Sized> ComposeSvcParamValue for Alpn<Octs>
source§fn compose_len(&self) -> u16
fn compose_len(&self) -> u16
source§fn compose_value<Target: OctetsBuilder + ?Sized>(
&self,
target: &mut Target,
) -> Result<(), Target::AppendError>
fn compose_value<Target: OctetsBuilder + ?Sized>( &self, target: &mut Target, ) -> Result<(), Target::AppendError>
target
.