[go: up one dir, main page]

tide 0.11.0

Serve the web – HTTP server framework
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use portpicker::pick_unused_port;

use std::future::Future;
use std::pin::Pin;

/// An owned dynamically typed [`Future`] for use in cases where you can't
/// statically type your result or need to add some indirection.
#[allow(dead_code)]
pub type BoxFuture<'a, T> = Pin<Box<dyn Future<Output = T> + Send + 'a>>;

/// Find an unused port.
#[allow(dead_code)]
pub async fn find_port() -> u16 {
    pick_unused_port().expect("No ports free")
}