[−][src]Struct simple_proxy::middlewares::cors::Cors
Methods
impl Cors
[src]
pub fn new(
allow_origin: &'static str,
allow_methods: &'static str,
allow_headers: &'static str
) -> Self
[src]
allow_origin: &'static str,
allow_methods: &'static str,
allow_headers: &'static str
) -> Self
Trait Implementations
impl Middleware for Cors
[src]
fn name() -> String
[src]
fn before_request(
&mut self,
req: &mut Request<Body>,
_req_id: u64,
_state: &State
) -> Result<MiddlewareResult, MiddlewareError>
[src]
&mut self,
req: &mut Request<Body>,
_req_id: u64,
_state: &State
) -> Result<MiddlewareResult, MiddlewareError>
fn after_request(
&mut self,
response: Option<&mut Response<Body>>,
_req_id: u64,
_state: &State
) -> Result<MiddlewareResult, MiddlewareError>
[src]
&mut self,
response: Option<&mut Response<Body>>,
_req_id: u64,
_state: &State
) -> Result<MiddlewareResult, MiddlewareError>
fn get_name(&self) -> String where
Self: Sized,
[src]
Self: Sized,
fn set_state(
&self,
req_id: u64,
state: &State,
data: String
) -> Result<(), MiddlewareError> where
Self: Sized,
[src]
&self,
req_id: u64,
state: &State,
data: String
) -> Result<(), MiddlewareError> where
Self: Sized,
fn state(req_id: u64, state: &State) -> Result<Option<String>, MiddlewareError> where
Self: Sized,
[src]
Self: Sized,
fn get_state(
&self,
req_id: u64,
state: &State
) -> Result<Option<String>, MiddlewareError> where
Self: Sized,
[src]
&self,
req_id: u64,
state: &State
) -> Result<Option<String>, MiddlewareError> where
Self: Sized,
fn request_failure(
&mut self,
_err: &Error,
_req_id: u64,
_state: &State
) -> Result<MiddlewareResult, MiddlewareError>
[src]
&mut self,
_err: &Error,
_req_id: u64,
_state: &State
) -> Result<MiddlewareResult, MiddlewareError>
fn request_success(
&mut self,
_res: &mut Response<Body>,
_req_id: u64,
_state: &State
) -> Result<MiddlewareResult, MiddlewareError>
[src]
&mut self,
_res: &mut Response<Body>,
_req_id: u64,
_state: &State
) -> Result<MiddlewareResult, MiddlewareError>
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.