pub struct HTTPHandler {
pub path: String,
pub proxy: String,
pub text: String,
pub accept_app_caps: Vec<String>,
pub redirect: String,
}Expand description
HTTPHandler is either a path or a proxy to serve.
Fields§
§path: Stringabsolute path to directory or file to serve
proxy: Stringhttp://localhost:3000/, localhost:3030, 3030
text: Stringplaintext to serve (primarily for testing)
accept_app_caps: Vec<String>peer capabilities to forward in grant header, e.g. example.com/cap/mon
redirect: StringRedirect, if not empty, is the target URL to redirect requests to.
By default, we redirect with HTTP 302 (Found) status.
If Redirect starts with ‘
The target URL supports the following expansion variables:
- ${HOST}: replaced with the request’s Host header value
- ${REQUEST_URI}: replaced with the request’s full URI (path and query string)
Trait Implementations§
Source§impl Clone for HTTPHandler
impl Clone for HTTPHandler
Source§fn clone(&self) -> HTTPHandler
fn clone(&self) -> HTTPHandler
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 HTTPHandler
impl Debug for HTTPHandler
Source§impl Default for HTTPHandler
impl Default for HTTPHandler
Source§fn default() -> HTTPHandler
fn default() -> HTTPHandler
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for HTTPHandler
impl<'de> Deserialize<'de> for HTTPHandler
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for HTTPHandler
impl RefUnwindSafe for HTTPHandler
impl Send for HTTPHandler
impl Sync for HTTPHandler
impl Unpin for HTTPHandler
impl UnsafeUnpin for HTTPHandler
impl UnwindSafe for HTTPHandler
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