Rename web::interface to web::ui

This commit is contained in:
Lucien Greathouse
2019-09-03 13:58:44 -07:00
parent a31bfbefa7
commit 27517e1aee
2 changed files with 11 additions and 11 deletions

View File

@@ -1,5 +1,5 @@
mod api; mod api;
mod interface; mod ui;
mod util; mod util;
use std::sync::Arc; use std::sync::Arc;
@@ -13,11 +13,11 @@ use log::trace;
use crate::serve_session::ServeSession; use crate::serve_session::ServeSession;
use self::{api::ApiService, interface::InterfaceService}; use self::{api::ApiService, ui::UiService};
pub struct RootService { pub struct RootService {
api: api::ApiService, api: ApiService,
interface: interface::InterfaceService, ui: UiService,
} }
impl Service for RootService { impl Service for RootService {
@@ -32,7 +32,7 @@ impl Service for RootService {
if request.uri().path().starts_with("/api") { if request.uri().path().starts_with("/api") {
self.api.call(request) self.api.call(request)
} else { } else {
self.interface.call(request) self.ui.call(request)
} }
} }
} }
@@ -41,7 +41,7 @@ impl RootService {
pub fn new(serve_session: Arc<ServeSession>) -> RootService { pub fn new(serve_session: Arc<ServeSession>) -> RootService {
RootService { RootService {
api: ApiService::new(Arc::clone(&serve_session)), api: ApiService::new(Arc::clone(&serve_session)),
interface: InterfaceService::new(Arc::clone(&serve_session)), ui: UiService::new(Arc::clone(&serve_session)),
} }
} }
} }

View File

@@ -10,12 +10,12 @@ use crate::{serve_session::ServeSession, web_interface::SERVER_VERSION};
static HOME_CSS: &str = include_str!("../../assets/index.css"); static HOME_CSS: &str = include_str!("../../assets/index.css");
pub struct InterfaceService { pub struct UiService {
#[allow(unused)] // TODO: Fill out interface service #[allow(unused)] // TODO: Fill out interface service
serve_session: Arc<ServeSession>, serve_session: Arc<ServeSession>,
} }
impl Service for InterfaceService { impl Service for UiService {
type ReqBody = Body; type ReqBody = Body;
type ResBody = Body; type ResBody = Body;
type Error = hyper::Error; type Error = hyper::Error;
@@ -36,9 +36,9 @@ impl Service for InterfaceService {
} }
} }
impl InterfaceService { impl UiService {
pub fn new(serve_session: Arc<ServeSession>) -> InterfaceService { pub fn new(serve_session: Arc<ServeSession>) -> UiService {
InterfaceService { serve_session } UiService { serve_session }
} }
fn handle_home(&self) -> Response<Body> { fn handle_home(&self) -> Response<Body> {