pub struct SnapTunEndpoint { /* private fields */ }Expand description
Snap tunnel endpoint that allows creating new snap tun connections. It holds one static identity and manages the registration of this identity with all connected control planes.
Implementations§
Source§impl SnapTunEndpoint
impl SnapTunEndpoint
Sourcepub fn new(
token_source: Arc<dyn TokenSource>,
static_private: StaticSecret,
) -> Self
pub fn new( token_source: Arc<dyn TokenSource>, static_private: StaticSecret, ) -> Self
Creates a new SNAP tunnel socket manager.
Sourcepub async fn connect_tunnel(
&self,
peer_public: PublicKey,
dataplane_address: SocketAddr,
control_plane: Url,
control_plane_client: Arc<dyn SnapTunControlPlaneClient>,
underlay_socket: Arc<UdpSocket>,
receive_queue_capacity: usize,
pool: PacketBufPool<PACKET_BUF_POOL_SIZE>,
) -> Result<SnapTunnel, ConnectSnapTunSocketError>
pub async fn connect_tunnel( &self, peer_public: PublicKey, dataplane_address: SocketAddr, control_plane: Url, control_plane_client: Arc<dyn SnapTunControlPlaneClient>, underlay_socket: Arc<UdpSocket>, receive_queue_capacity: usize, pool: PacketBufPool<PACKET_BUF_POOL_SIZE>, ) -> Result<SnapTunnel, ConnectSnapTunSocketError>
Connects a new SNAP tunnel. If the endpoints static identity is not already registered with the selected snap-tun control plane, it is registered before this method returns.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SnapTunEndpoint
impl RefUnwindSafe for SnapTunEndpoint
impl Send for SnapTunEndpoint
impl Sync for SnapTunEndpoint
impl Unpin for SnapTunEndpoint
impl UnsafeUnpin for SnapTunEndpoint
impl UnwindSafe for SnapTunEndpoint
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