pub struct Proxy { /* private fields */ }Expand description
A configured proxy; Proxy::serve runs it on a listener.
Implementations§
Source§impl Proxy
impl Proxy
Sourcepub fn new(rules: Rules, log: Log) -> Proxy
pub fn new(rules: Rules, log: Log) -> Proxy
The proxy as it runs for real: the system resolver, and deny::denied with this
machine’s own addresses.
Sourcepub fn serve(self, listener: TcpListener) -> JoinHandle<()>
pub fn serve(self, listener: TcpListener) -> JoinHandle<()>
Accepts connections on listener until it fails, one thread per connection.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Proxy
impl !UnwindSafe for Proxy
impl Forget for Proxy
impl Freeze for Proxywhere
*const ArcInner<Rules> is !null: Freeze,
PhantomData<ArcInner<Rules>>: Freeze,
*const ArcInner<dyn Fn(&Decision) + Send + Sync> is !null: Freeze,
PhantomData<ArcInner<dyn Fn(&Decision) + Send + Sync>>: Freeze,
*const ArcInner<dyn Fn(&str, u16) -> Result<Vec<SocketAddr>, Error> + Send + Sync> is !null: Freeze,
PhantomData<ArcInner<dyn Fn(&str, u16) -> Result<Vec<SocketAddr>, Error> + Send + Sync>>: Freeze,
*const ArcInner<dyn Fn(IpAddr) -> Option<Denial> + Send + Sync> is !null: Freeze,
PhantomData<ArcInner<dyn Fn(IpAddr) -> Option<Denial> + Send + Sync>>: Freeze,
*const ArcInner<Atomic<usize>> is !null: Freeze,
PhantomData<ArcInner<Atomic<usize>>>: Freeze,
impl Move for Proxy
impl Send for Proxy
impl Sync for Proxy
impl Unpin for Proxy
impl UnsafeUnpin for Proxywhere
*const ArcInner<Rules> is !null: UnsafeUnpin,
PhantomData<ArcInner<Rules>>: UnsafeUnpin,
*const ArcInner<dyn Fn(&Decision) + Send + Sync> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn(&Decision) + Send + Sync>>: UnsafeUnpin,
*const ArcInner<dyn Fn(&str, u16) -> Result<Vec<SocketAddr>, Error> + Send + Sync> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn(&str, u16) -> Result<Vec<SocketAddr>, Error> + Send + Sync>>: UnsafeUnpin,
*const ArcInner<dyn Fn(IpAddr) -> Option<Denial> + Send + Sync> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn(IpAddr) -> Option<Denial> + Send + Sync>>: UnsafeUnpin,
*const ArcInner<Atomic<usize>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Atomic<usize>>>: UnsafeUnpin,
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