pub enum RequestResult {
Ok(Request),
InvalidHttpMethod,
NoRequestedPath,
InvalidHttpVersion,
InvalidHeader,
FileNotFound(Box<str>),
}Expand description
The result of a request. This doesn’t report IO errors, since in a case of such error no request is registered.
Variants§
Ok(Request)
Everything went normally and the client received a 200 response
InvalidHttpMethod
Unsupported or invalid HTTP method was provided in the request.
This crate only supports GET requests.
NoRequestedPath
No path was provided in the request.
InvalidHttpVersion
Unsupported HTTP version provided in the request.
This crate only supports HTTP/1.1
InvalidHeader
One of the headers in the request was invalid.
At the moment, this only triggers on an invalid If-None-Match header, the server ignores
all other headers.
FileNotFound(Box<str>)
Request file does not exist or is outside the root of the server.
Contained is the path as requested by the client (“/” is replaced with “/index.html”)
Trait Implementations§
Source§impl Clone for RequestResult
impl Clone for RequestResult
Source§fn clone(&self) -> RequestResult
fn clone(&self) -> RequestResult
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RequestResult
impl Debug for RequestResult
Source§impl PartialEq for RequestResult
impl PartialEq for RequestResult
impl Eq for RequestResult
impl StructuralPartialEq for RequestResult
Auto Trait Implementations§
impl Freeze for RequestResult
impl RefUnwindSafe for RequestResult
impl Send for RequestResult
impl Sync for RequestResult
impl Unpin for RequestResult
impl UnwindSafe for RequestResult
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