pub struct UdpUnderlayConfig { /* private fields */ }Expand description
UDP underlay configuration.
Construct with UdpUnderlayConfig::default and customize with the consuming with_* methods,
then pass to ScionStackBuilder::with_udp_underlay_config.
Implementations§
Source§impl UdpUnderlayConfig
impl UdpUnderlayConfig
Sourcepub fn with_outbound_ips(self, outbound_ips: Vec<IpAddr>) -> Self
pub fn with_outbound_ips(self, outbound_ips: Vec<IpAddr>) -> Self
Sets the outbound IP addresses to use for the UDP underlay.
If not set, the UDP underlay will use the local IP that can reach the endhost API.
This is a convenience wrapper around Self::with_outbound_ip_resolver for a fixed set of
addresses.
Sourcepub fn with_outbound_ip_resolver(
self,
resolver: impl OutboundIpResolver + 'static,
) -> Self
pub fn with_outbound_ip_resolver( self, resolver: impl OutboundIpResolver + 'static, ) -> Self
Sets a custom outbound IP resolver for the UDP underlay.
Use this method when outbound IP resolution does not depend on the selected endhost API URL.
If the resolver needs the endhost API URL, use Self::with_outbound_ip_resolver_factory
instead.
By default, TargetAddrOutboundIpResolver is used, which resolves the endhost API
hostname via OS DNS.
Sourcepub fn with_outbound_ip_resolver_factory<F, R>(self, factory: F) -> Self
pub fn with_outbound_ip_resolver_factory<F, R>(self, factory: F) -> Self
Sets a factory that builds the UDP underlay’s outbound IP resolver from the selected endhost API URL.
The winning endhost API URL is only known once the stack connects during
ScionStackBuilder::build, so resolvers that depend on it must be constructed via this
factory. The factory is invoked once with the selected URL.
Use this when the hostname is only resolvable through a custom DNS override that is
invisible to the OS resolver, or to provide a fully custom URL-aware resolution
strategy. If the resolver does not need the URL, use Self::with_outbound_ip_resolver
instead.
Sourcepub fn with_udp_next_hop_resolver_fetch_interval(
self,
fetch_interval: Duration,
) -> Self
pub fn with_udp_next_hop_resolver_fetch_interval( self, fetch_interval: Duration, ) -> Self
Sets the interval at which the UDP next hop resolver fetches the next hops from the endhost API.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for UdpUnderlayConfig
impl !Sync for UdpUnderlayConfig
impl !UnwindSafe for UdpUnderlayConfig
impl Freeze for UdpUnderlayConfig
impl Send for UdpUnderlayConfig
impl Unpin for UdpUnderlayConfig
impl UnsafeUnpin for UdpUnderlayConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request