pub struct Control { /* private fields */ }Expand description
Control can be used to send control messages to the server
Implementations§
Source§impl Control
impl Control
Sourcepub fn assigned_sock_addr(&self) -> Option<SocketAddr>
pub fn assigned_sock_addr(&self) -> Option<SocketAddr>
Returns the socket address assigned by the server. This typically corresponds to the client’s remote socket address; i.e. the possibly NAT’ed address of the client visible to the server.
It is up to the client to use the correct ISD-AS for this tunnel.
Sourcepub fn token_expiry(&self) -> SystemTime
pub fn token_expiry(&self) -> SystemTime
Returns the token expiry time.
Sourcepub fn snap_token(&self) -> String
pub fn snap_token(&self) -> String
Returns the current SNAP token.
Sourcepub async fn update_token(&mut self) -> Result<(), ControlError>
pub async fn update_token(&mut self) -> Result<(), ControlError>
Sends a new SNAP token to keep the snaptun connection with the server established.
Sourcepub async fn closed(&self) -> ConnectionError
pub async fn closed(&self) -> ConnectionError
An async function that returns when the underlying connection is closed.
Sourcepub fn inner_conn(&self) -> Connection
pub fn inner_conn(&self) -> Connection
Returns the underlying QUIC connection.
Sourcepub fn debug_path_stats(&self) -> impl Debug + 'static + use<>
pub fn debug_path_stats(&self) -> impl Debug + 'static + use<>
This is a helper function that returns a debug-printable object containing metrics about the underlying QUIC-connection.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Control
impl RefUnwindSafe for Control
impl Send for Control
impl Sync for Control
impl Unpin for Control
impl UnwindSafe for Control
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> 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>
Converts
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>
Converts
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>
Wrap the input message
T in a tonic::Request