pub trait Tunnel: Stream<Item = Result<Conn, AcceptError>> + Accept<Conn = Conn, Error = AcceptError> + Unpin + Send + 'static {
// Required methods
fn id(&self) -> &str;
fn forwards_to(&self) -> &str;
fn metadata(&self) -> &str;
fn close<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), RpcError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}
Expand description
Required Methods§
sourcefn forwards_to(&self) -> &str
fn forwards_to(&self) -> &str
Returns a human-readable string presented in the ngrok dashboard and the Tunnels API. Use the HttpTunnelBuilder::forwards_to, TcpTunnelBuilder::forwards_to, etc. to set this value explicitly.
sourcefn close<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), RpcError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn close<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<(), RpcError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Close the tunnel.
This is an RPC call that must be .await
ed.
It is equivalent to calling Session::close_tunnel
with this
tunnel’s ID.
If the tunnel is dropped, a task will be spawned to close it asynchronously.