pub struct Router { /* private fields */ }Expand description
Routes incoming requests to appropriate tunnel connections
Implementations§
Source§impl Router
impl Router
pub fn new() -> Arc<Self>
Sourcepub fn register(
&self,
subdomain: String,
handle: TunnelHandle,
tcp_port: Option<u16>,
) -> Result<(), RouterError>
pub fn register( &self, subdomain: String, handle: TunnelHandle, tcp_port: Option<u16>, ) -> Result<(), RouterError>
Register a new tunnel
Sourcepub fn unregister(&self, subdomain: &str) -> Option<TunnelHandle>
pub fn unregister(&self, subdomain: &str) -> Option<TunnelHandle>
Unregister a tunnel
Sourcepub fn get_sender(&self, subdomain: &str) -> Option<Sender<ServerMessage>>
pub fn get_sender(&self, subdomain: &str) -> Option<Sender<ServerMessage>>
Get a sender for a subdomain
Sourcepub fn get_subdomain_for_port(&self, port: u16) -> Option<String>
pub fn get_subdomain_for_port(&self, port: u16) -> Option<String>
Get subdomain for a TCP port
Sourcepub fn is_available(&self, subdomain: &str) -> bool
pub fn is_available(&self, subdomain: &str) -> bool
Check if a subdomain is available
Sourcepub fn list_subdomains(&self) -> Vec<String>
pub fn list_subdomains(&self) -> Vec<String>
List all active subdomains
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Router
impl !RefUnwindSafe for Router
impl Send for Router
impl Sync for Router
impl Unpin for Router
impl UnwindSafe for Router
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