pub struct ClientBuilder { /* private fields */ }Expand description
SNAP tunnel client builder.
Implementations§
Source§impl ClientBuilder
impl ClientBuilder
Sourcepub fn new<S: AsRef<str>>(initial_session_token: S) -> Self
pub fn new<S: AsRef<str>>(initial_session_token: S) -> Self
Client builder with an initial session token to be used to authenticate requests.
Sourcepub fn with_desired_addresses(self, desired_addresses: Vec<EndhostAddr>) -> Self
pub fn with_desired_addresses(self, desired_addresses: Vec<EndhostAddr>) -> Self
Set the desired addresses to be requested from the SNAP. If empty, the SNAP server will assign an address.
Sourcepub fn with_auto_session_renewal(
self,
session_renewal: AutoSessionRenewal,
) -> Self
pub fn with_auto_session_renewal( self, session_renewal: AutoSessionRenewal, ) -> Self
Enable automatic session renewal.
Sourcepub async fn connect(
self,
conn: Connection,
) -> Result<(Sender, Receiver, Control), SnapTunError>
pub async fn connect( self, conn: Connection, ) -> Result<(Sender, Receiver, Control), SnapTunError>
Establish a SNAP tunnel using the provided QUIC connection using the builder’s settings.
Auto Trait Implementations§
impl Freeze for ClientBuilder
impl !RefUnwindSafe for ClientBuilder
impl Send for ClientBuilder
impl Sync for ClientBuilder
impl Unpin for ClientBuilder
impl !UnwindSafe for ClientBuilder
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