dhomer 0.1.0

Simple and easy to use, a proxy server based on Pingora
use std::collections::HashSet;
use crate::config::address::Address;

#[derive(Debug)]
pub struct ProxyEntrySetting {
    rewrite: bool,
    upstreams: HashSet<Address>,
}

impl ProxyEntrySetting {
    pub fn new(rewrite: bool, upstreams: HashSet<Address>) -> Self {
        Self { rewrite, upstreams }
    }
    
    pub fn rewrite(&self) -> bool {
        self.rewrite
    }
    
    pub fn upstreams(&self) -> impl Iterator<Item = &Address> {
        self.upstreams.iter()
    }
    
    pub fn take_upstreams(self) -> HashSet<Address> {
        self.upstreams
    }
}