pub struct SnapUnderlayConfigBuilder(/* private fields */);Expand description
SNAP underlay configuration builder.
Implementations§
Source§impl SnapUnderlayConfigBuilder
impl SnapUnderlayConfigBuilder
Sourcepub fn with_auth_token(self, token: String) -> Self
pub fn with_auth_token(self, token: String) -> Self
Set a static token to use for authentication with the SNAP control plane.
Sourcepub fn with_auth_token_source(self, source: impl TokenSource) -> Self
pub fn with_auth_token_source(self, source: impl TokenSource) -> Self
Set a token source to use for authentication with the SNAP control plane.
Sourcepub fn with_requested_addresses(
self,
requested_addresses: Vec<EndhostAddr>,
) -> Self
pub fn with_requested_addresses( self, requested_addresses: Vec<EndhostAddr>, ) -> Self
Set the addresses to request from the SNAP server. Note, that the server may choose not to assign all requested addresses and may assign additional addresses. Use assigned_addresses() to get the final list of addresses.
§Arguments
requested_addresses- The addresses to request from the SNAP server.
Sourcepub fn with_ports_rng(self, rng: ChaCha8Rng) -> Self
pub fn with_ports_rng(self, rng: ChaCha8Rng) -> Self
Set the random number generator used for port allocation.
§Arguments
rng- The random number generator.
Sourcepub fn with_ports_reserved_time(self, reserved_time: Duration) -> Self
pub fn with_ports_reserved_time(self, reserved_time: Duration) -> Self
Set how long ports are reserved after they are released.
§Arguments
reserved_time- The reserved time for ports.
Sourcepub fn with_default_scmp_handler(
self,
default_scmp_handler: Box<dyn FnOnce(Arc<SnapTunnel>) -> Arc<dyn ScmpHandler> + Sync + Send + 'static>,
) -> Self
pub fn with_default_scmp_handler( self, default_scmp_handler: Box<dyn FnOnce(Arc<SnapTunnel>) -> Arc<dyn ScmpHandler> + Sync + Send + 'static>, ) -> Self
Sourcepub fn with_session_auto_renewal(self, interval: Duration) -> Self
pub fn with_session_auto_renewal(self, interval: Duration) -> Self
Sourcepub fn with_snap_dp_index(self, dp_index: usize) -> Self
pub fn with_snap_dp_index(self, dp_index: usize) -> Self
Set the index of the SNAP data plane to use.
§Arguments
dp_index- The index of the SNAP data plane to use.
Sourcepub fn build(self) -> SnapUnderlayConfig
pub fn build(self) -> SnapUnderlayConfig
Auto Trait Implementations§
impl Freeze for SnapUnderlayConfigBuilder
impl !RefUnwindSafe for SnapUnderlayConfigBuilder
impl Send for SnapUnderlayConfigBuilder
impl Sync for SnapUnderlayConfigBuilder
impl Unpin for SnapUnderlayConfigBuilder
impl !UnwindSafe for SnapUnderlayConfigBuilder
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
Mutably borrows from an owned value. Read more
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request