pub struct SnapTunnel { /* private fields */ }Expand description
A SNAP tunnel connection.
Implementations§
Source§impl SnapTunnel
impl SnapTunnel
Sourcepub fn try_send(&self, packet: Packet) -> Result<()>
pub fn try_send(&self, packet: Packet) -> Result<()>
Try to send a packet to the remote server. Returns error of try_send_to.
Sourcepub async fn recv(&self) -> Result<Bytes, SnapTunnelReceiveError>
pub async fn recv(&self) -> Result<Bytes, SnapTunnelReceiveError>
Receive a packet from the remote server.
Sourcepub fn poll_recv(
&self,
cx: &mut Context<'_>,
) -> Poll<Result<Bytes, SnapTunnelReceiveError>>
pub fn poll_recv( &self, cx: &mut Context<'_>, ) -> Poll<Result<Bytes, SnapTunnelReceiveError>>
Poll for a packet from the remote server.
Sourcepub fn local_addr(&self) -> SocketAddr
pub fn local_addr(&self) -> SocketAddr
Get the local socket address. Assigned by the remote server.
Sourcepub fn data_plane_address(&self) -> SocketAddr
pub fn data_plane_address(&self) -> SocketAddr
The data plane the tunnel is connected to.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for SnapTunnel
impl RefUnwindSafe for SnapTunnel
impl Send for SnapTunnel
impl Sync for SnapTunnel
impl !Unpin for SnapTunnel
impl !UnsafeUnpin for SnapTunnel
impl UnwindSafe for SnapTunnel
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 more