pub struct HttpRequest {
pub id: u128,
pub route: string,
pub path: string,
pub parameters: StringMap,
pub method: HttpMethod,
pub authorization: Option<Secret>,
pub cookie: Option<Secret>,
pub secret_headers: Map,
}Expand description
Describes HTTP request data.
id: identifier of connection, it is an arbitrary number that uniquely identifies a HTTP connection to a server.route: the route used by the request.path: the path called by the request.parameters: the parameters from the route.method: the HTTP method used by the request.authorization: theAuthorizationheader, if any.cookie: theCookieheader, if any.secret_headers: the headers listed in thesecret_headersof the server, present in the request, asSecret<string>values named after the headers as listed.
Authorization, Cookie and the secret_headers of the server are only given as secrets,
and are left out of the request headers.
They come from the client, so the plain std/secret::reveal treatment may reveal them,
for example to compare a token, and they are masked in logs once revealed.
crypto/token::check compares them with a secret without revealing them to the program.
Fields§
§id: u128§route: string§path: string§parameters: StringMap§method: HttpMethod§secret_headers: MapTrait Implementations§
Source§impl Context for HttpRequest
impl Context for HttpRequest
Auto Trait Implementations§
impl !RefUnwindSafe for HttpRequest
impl !UnwindSafe for HttpRequest
impl Forget for HttpRequest
impl Freeze for HttpRequest
impl Send for HttpRequest
impl Sync for HttpRequest
impl Unpin for HttpRequest
impl UnsafeUnpin for HttpRequest
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.