use a trait object for the server, for dynamic dispatch

This commit is contained in:
Dustin J. Mitchell
2020-11-26 10:52:28 -05:00
parent 087333a227
commit a5c06008b3
5 changed files with 36 additions and 15 deletions

View File

@@ -1,11 +1,10 @@
use crate::server::SyncServer;
use crate::api::ServerState;
use crate::types::{ClientId, VersionId};
use actix_web::{error, get, http::StatusCode, web, HttpResponse, Result};
use std::sync::Arc;
#[get("/client/{client_id}/get-child-version/{parent_version_id}")]
pub(crate) async fn service(
data: web::Data<Arc<SyncServer>>,
data: web::Data<ServerState>,
web::Path((client_id, parent_version_id)): web::Path<(ClientId, VersionId)>,
) -> Result<HttpResponse> {
let result = data