pub struct SocketConfig { /* private fields */ }Expand description
Configuration for a path aware socket.
Implementations§
Source§impl SocketConfig
impl SocketConfig
Sourcepub fn with_path_policy(self, policy: impl PathPolicy) -> Self
pub fn with_path_policy(self, policy: impl PathPolicy) -> Self
Adds a path policy.
Path policies can restrict the set of usable paths based on their characteristics. E.g. filtering out paths that go through certain ASes.
See HopPatternPolicy and
AclPolicy
Sourcepub fn with_path_scoring(self, scoring: impl PathScoring, impact: f32) -> Self
pub fn with_path_scoring(self, scoring: impl PathScoring, impact: f32) -> Self
Add a path scoring strategy.
Path scores signal which paths to prioritize based on their characteristics.
scoring - The path scoring strategy to add.
impact - The impact weight of the scoring strategy. Higher values increase the influence
If no scoring strategies are added, scoring defaults to preferring shorter and more reliable paths.
Sourcepub fn with_connection_timeout(self, timeout: Duration) -> Self
pub fn with_connection_timeout(self, timeout: Duration) -> Self
Sets connection timeout for connect functions
Defaults to DEFAULT_CONNECT_TIMEOUT
Sourcepub fn with_segment_fetcher(
self,
name: String,
fetcher: Box<dyn SegmentFetcher>,
) -> Self
pub fn with_segment_fetcher( self, name: String, fetcher: Box<dyn SegmentFetcher>, ) -> Self
Add an additional segment fetcher.
By default, only path segments retrieved via the endhost API are used. Adding additional segment fetchers enables to build paths from different segment sources.
Sourcepub fn disable_endhost_api_segment_fetcher(self) -> Self
pub fn disable_endhost_api_segment_fetcher(self) -> Self
Disable fetching path segments from the endhost API.
Sourcepub fn with_segment_fetcher_timeout(self, timeout: Duration) -> Self
pub fn with_segment_fetcher_timeout(self, timeout: Duration) -> Self
Sets the segment fetcher timeout. The timeout prevents waiting indefinitely for slow or unresponsive segment fetchers. If a fetcher does not respond within the timeout, it will be skipped for the current path lookup.
Defaults to DEFAULT_SEGMENT_FETCHER_TIMEOUT.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SocketConfig
impl !RefUnwindSafe for SocketConfig
impl Send for SocketConfig
impl Sync for SocketConfig
impl Unpin for SocketConfig
impl UnsafeUnpin for SocketConfig
impl !UnwindSafe for SocketConfig
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> 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