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
    }
}