atlasserver 0.3.0

Atlas is a rust library for the purpose of composing REST APIs out of re-usable and extensible modules, specifically with supporting the networking needs of online gaming services in mind.
use frunk::Hlist;
use warp::{filters::BoxedFilter, Filter, Reply};

use crate::{CustomModule, ModuleResources};

pub struct Status {}

impl CustomModule for Status {
	type Resources = Hlist!();

	fn create_filter<S: ModuleResources<Self>>(
		_: std::sync::Arc<S>,
	) -> warp::filters::BoxedFilter<(Box<dyn warp::Reply>,)> {
		let filter: BoxedFilter<(Box<dyn Reply>,)> =
			warp::path!("status")
				.map(warp::reply::reply)
				.map(|reply| -> Box<dyn Reply> { Box::new(reply) })
				.boxed();
		filter
	}
}