pub struct WajServer { /* private fields */ }Implementations§
Source§impl WajServer
impl WajServer
pub fn open(path: &Path) -> Result<Self, WajError>
pub fn new(waj: Arc<Waj>, etag_value: String) -> Self
Sourcepub fn handle(&self, request: Request, url: &str, request_id: usize)
pub fn handle(&self, request: Request, url: &str, request_id: usize)
Handle a request.
This is mainly a wrapper around handle_get as we respond only to get/head request.
The main work here is to:
- Handle error (by returning a 500)
- Handle get vs head (by requesting response without content)
- Handle etag by requesting response without content if etag match and answering a 304.
Cache header is not handle here as it depends of the response itself.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WajServer
impl !RefUnwindSafe for WajServer
impl Send for WajServer
impl Sync for WajServer
impl Unpin for WajServer
impl !UnwindSafe for WajServer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more