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
.source§impl<O, OO> OctetsFrom<Alpn<O>> for Alpn<OO>where
OO: OctetsFrom<O>,
impl<O, OO> OctetsFrom<Alpn<O>> for Alpn<OO>where
OO: OctetsFrom<O>,
type Error = <OO as OctetsFrom<O>>::Error
source§impl<'a, Octs> ParseSvcParamValue<'a, Octs> for Alpn<Octs::Range<'a>>
impl<'a, Octs> ParseSvcParamValue<'a, Octs> for Alpn<Octs::Range<'a>>
source§fn parse_value(
key: SvcParamKey,
parser: &mut Parser<'a, Octs>,
) -> Result<Option<Self>, ParseError>
fn parse_value( key: SvcParamKey, parser: &mut Parser<'a, Octs>, ) -> Result<Option<Self>, ParseError>
source§impl<Octs: ?Sized> SvcParamValue for Alpn<Octs>
impl<Octs: ?Sized> SvcParamValue for Alpn<Octs>
source§fn key(&self) -> SvcParamKey
fn key(&self) -> SvcParamKey
impl<Octs: AsRef<[u8]>> Eq for Alpn<Octs>
Auto Trait Implementations§
impl<Octs> Freeze for Alpn<Octs>
impl<Octs> RefUnwindSafe for Alpn<Octs>where
Octs: RefUnwindSafe + ?Sized,
impl<Octs> Send for Alpn<Octs>
impl<Octs> Sync for Alpn<Octs>
impl<Octs> Unpin for Alpn<Octs>
impl<Octs> UnwindSafe for Alpn<Octs>where
Octs: UnwindSafe + ?Sized,
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)