Struct TailscaleTunnel
pub struct TailscaleTunnel { /* private fields */ }Expand description
Tailscale Tunnel — uses tailscale serve (tailnet-only) or
tailscale funnel (public internet).
Requires Tailscale installed and authenticated (tailscale up).
Every process it starts runs in the foreground, where tailscaled keeps a
session’s serve config exactly as long as the process lives, and is owned
by a ServeProcess watcher: an exit is reaped and reported at once
rather than left as a zombie that still looks alive, and ending the
watcher withdraws what the process published.
Implementations§
Trait Implementations§
Source§impl Tunnel for TailscaleTunnel
impl Tunnel for TailscaleTunnel
Source§fn start<'life0, 'life1, 'async_trait>(
&'life0 self,
_local_host: &'life1 str,
local_port: u16,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn start<'life0, 'life1, 'async_trait>(
&'life0 self,
_local_host: &'life1 str,
local_port: u16,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Publish the gateway and return its URL only once tailscaled is actually serving it from this process. A process that exits instead (port 443 held by another session, a rejected config write) fails the start with its stderr, so the gateway falls back to local-only rather than advertising a URL nothing serves.
Source§fn stop<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stop<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Withdraw what this tunnel published by ending the processes it started:
the gateway’s serve/funnel and each TCP forwarder. All of them run
in the foreground, so tailscaled drops their config when they exit.
The node’s serve config is never reset: the operator’s own --bg
entries and other processes’ sessions live in it too.
Source§fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Healthy while the gateway serve process and every published TCP forwarder are still running. A process that exited is reaped by its watcher at once, so an exit shows up here instead of hiding as a zombie.
Source§fn publish_tcp_services<'life0, 'life1, 'async_trait>(
&'life0 self,
services: &'life1 [TcpService],
) -> Pin<Box<dyn Future<Output = Result<Vec<PublishedTcpService>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn publish_tcp_services<'life0, 'life1, 'async_trait>(
&'life0 self,
services: &'life1 [TcpService],
) -> Pin<Box<dyn Future<Output = Result<Vec<PublishedTcpService>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
start. Returns only the services actually
published. Providers without raw TCP passthrough publish nothing,
which keeps those listeners at their configured bind.Source§fn public_url(&self) -> Option<String>
fn public_url(&self) -> Option<String>
Auto Trait Implementations§
impl !Freeze for TailscaleTunnel
impl !RefUnwindSafe for TailscaleTunnel
impl !UnwindSafe for TailscaleTunnel
impl Send for TailscaleTunnel
impl Sync for TailscaleTunnel
impl Unpin for TailscaleTunnel
impl UnsafeUnpin for TailscaleTunnel
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
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> ⓘ
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