pub struct Forward {
pub subdomain: Option<String>,
pub location: String,
pub forward_type: ForwardType,
pub include_path: bool,
pub wildcard: bool,
}
Expand description
A url forwarding configuration
Fields§
§subdomain: Option<String>
The subdomain to forward, or None to forward the root domain
location: String
The location to forward to
forward_type: ForwardType
The type of redirect to use (permanent or temporary)
include_path: bool
Whether to include the path in the forwarded request
wildcard: bool
Whether to forward all subdomains
Implementations§
Source§impl Forward
impl Forward
Sourcepub fn new(subdomain: Option<impl Into<String>>, to: impl Into<String>) -> Self
pub fn new(subdomain: Option<impl Into<String>>, to: impl Into<String>) -> Self
creates a new Forward configuration with the given subdomain and location. Sets the forward_type to temporary, includes the path, and does not enable wildcard forwarding.
Sourcepub fn with_wildcard(self, wildcard: bool) -> Self
pub fn with_wildcard(self, wildcard: bool) -> Self
Enable or disable wildcard forwarding
Sourcepub fn include_path(self, include_path: bool) -> Self
pub fn include_path(self, include_path: bool) -> Self
Include or exclude the path in the forwarded request
Sourcepub fn with_forward_type(self, forward_type: ForwardType) -> Self
pub fn with_forward_type(self, forward_type: ForwardType) -> Self
Set the forward type to either temporary or permanent
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Forward
impl<'de> Deserialize<'de> for Forward
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 Forward
impl RefUnwindSafe for Forward
impl Send for Forward
impl Sync for Forward
impl Unpin for Forward
impl UnwindSafe for Forward
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