-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(socket): warp socket into a arc and a mutex
- Loading branch information
Showing
6 changed files
with
75 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
//! # Oblivion Default Handler | ||
use super::render::{BaseResponse, Response}; | ||
use super::session::Session; | ||
use futures::FutureExt; | ||
use super::{ | ||
render::{BaseResponse, Response}, | ||
session::Session, | ||
}; | ||
use oblivion_codegen::async_route; | ||
|
||
/// Not Found Handler | ||
/// | ||
/// Handling a non-existent route request. | ||
pub fn not_found(session: &mut Session) -> Response { | ||
let olps = session.request.as_mut().unwrap().get_ip(); | ||
async move { | ||
Ok(BaseResponse::TextResponse( | ||
format!("Path {} is not found, error with code 404.", olps), | ||
404, | ||
)) | ||
} | ||
.boxed() | ||
#[async_route] | ||
pub fn not_found(mut sess: Session) -> Response { | ||
let olps = sess.request.as_mut().unwrap().get_ip(); | ||
|
||
Ok(BaseResponse::TextResponse( | ||
format!("Path {} is not found, error with code 404.", olps), | ||
404, | ||
)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters