pub struct ConnectOptions { /* private fields */ }Expand description
Options for the Endpoint::connect_with_opts function.
Implementations§
Source§impl ConnectOptions
impl ConnectOptions
Sourcepub fn new() -> Self
pub fn new() -> Self
Initializes new connection options.
By default, the connection will use the same options
as Endpoint::connect, e.g. a default QuicTransportConfig.
Sourcepub fn with_transport_config(
self,
transport_config: QuicTransportConfig,
) -> Self
pub fn with_transport_config( self, transport_config: QuicTransportConfig, ) -> Self
Sets the QUIC transport config options for this connection.
Sourcepub fn with_additional_alpns(self, alpns: Vec<Vec<u8>>) -> Self
pub fn with_additional_alpns(self, alpns: Vec<Vec<u8>>) -> Self
Sets ALPN identifiers that should be signaled as supported on connection, in
addition to the main ALPN identifier used in Endpoint::connect_with_opts.
This allows connecting to servers that may only support older versions of your protocol. In this case, you would add the older ALPN identifiers with this function.
You’ll know the final negotiated ALPN identifier once your connection was
established using Connection::alpn, or even slightly earlier in the
handshake by using Connecting::alpn.
The negotiated ALPN identifier may be any of the ALPN identifiers in this
list or the main ALPN used in Endpoint::connect_with_opts.
The ALPN identifier order on the connect side doesn’t matter, since it’s the accept side that determines the protocol.
For setting the supported ALPN identifiers on the accept side, see the endpoint
builder’s Builder::alpns function.
Trait Implementations§
Source§impl Clone for ConnectOptions
impl Clone for ConnectOptions
Source§fn clone(&self) -> ConnectOptions
fn clone(&self) -> ConnectOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ConnectOptions
impl Debug for ConnectOptions
Source§impl Default for ConnectOptions
impl Default for ConnectOptions
Source§fn default() -> ConnectOptions
fn default() -> ConnectOptions
Auto Trait Implementations§
impl Freeze for ConnectOptions
impl !RefUnwindSafe for ConnectOptions
impl Send for ConnectOptions
impl Sync for ConnectOptions
impl Unpin for ConnectOptions
impl !UnwindSafe for ConnectOptions
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more