pub struct Tunnel { /* private fields */ }Expand description
A quick trycloudflare.com tunnel process. Named-tunnel configuration is
deliberately supplied by the CLI/setup layer; this type only owns the
sidecar lifecycle and URL discovery.
Implementations§
Source§impl Tunnel
impl Tunnel
Sourcepub async fn quick(port: u16) -> Result<Self>
pub async fn quick(port: u16) -> Result<Self>
Start a quick tunnel to a loopback host port. URL discovery is bounded; a running process with no parsed URL is still returned so callers can report “started, URL unknown” instead of hanging forever.
Sourcepub fn named(config: &Path, tunnel_id: &str) -> Result<Self>
pub fn named(config: &Path, tunnel_id: &str) -> Result<Self>
Start a named tunnel from a generated cloudflared config.
Sourcepub fn public_url(&self) -> Option<&str>
pub fn public_url(&self) -> Option<&str>
The parsed public URL, if cloudflared printed one during startup.
Auto Trait Implementations§
impl !RefUnwindSafe for Tunnel
impl !UnwindSafe for Tunnel
impl Freeze for Tunnel
impl Send for Tunnel
impl Sync for Tunnel
impl Unpin for Tunnel
impl UnsafeUnpin for Tunnel
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.