gis_puller 0.1.1

Geographic Information System (GIS) datasets acquisition library.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! HTTP Server Mock provides httpmock MockServer instance for development testing
use httpmock::MockServer;
use httpmock::Method::GET;
use tokio::io::{self, AsyncReadExt};
use tokio::fs::File;
use std::path::Path;
use std::sync::{Arc,RwLock, RwLockReadGuard, RwLockWriteGuard};
use state::Storage;

// @NOTE regression tokio::fs: https://github.com/tokio-rs/tokio/issues/1844
/// Re-uses a mock HTTP Server from a pool using httpmock MockServer and returns it
pub async fn serve() -> Result<MockServer, Box<dyn std::error::Error>> {
    
    // @TODO: Make this a macro_rules!
    let server = MockServer::start_async().await;
    
    Ok(server)
}