pub struct Proxy {
pub addr: SocketAddr,
pub auth: Option<&'static str>,
pub key: PathBuf,
pub cert: PathBuf,
pub edit_request: fn(Request) -> BoxFuture<'static, Result<Request, ()>>,
pub edit_response: fn(Response) -> BoxFuture<'static, Result<Response, ()>>,
}
Fields§
§addr: SocketAddr
§auth: Option<&'static str>
§key: PathBuf
§cert: PathBuf
§edit_request: fn(Request) -> BoxFuture<'static, Result<Request, ()>>
§edit_response: fn(Response) -> BoxFuture<'static, Result<Response, ()>>
Implementations§
Source§impl Proxy
impl Proxy
pub fn new( addr: SocketAddr, auth: Option<&'static str>, key: PathBuf, cert: PathBuf, ) -> Self
pub fn edit_request_using( &mut self, f: fn(Request) -> BoxFuture<'static, Result<Request, ()>>, )
pub fn edit_response_using( &mut self, f: fn(Response) -> BoxFuture<'static, Result<Response, ()>>, )
pub async fn start(self) -> Result<(), Error>
Auto Trait Implementations§
impl Freeze for Proxy
impl RefUnwindSafe for Proxy
impl Send for Proxy
impl Sync for Proxy
impl Unpin for Proxy
impl UnwindSafe for Proxy
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