use std::{net::SocketAddr, num::NonZeroU16};

use super::{PortChooser, Resolvers};

pub(crate) struct EmptyResolvers;

impl Resolvers for EmptyResolvers {
    fn new(_: PortChooser<NonZeroU16>) -> eyre::Result<Self> {
        Ok(Self)
    }
}

impl Iterator for EmptyResolvers {
    type Item = eyre::Result<SocketAddr>;

    fn next(&mut self) -> Option<Self::Item> {
        None
    }
}

pub(crate) fn resolvers(port: PortChooser<NonZeroU16>) -> eyre::Result<impl Resolvers> {
    EmptyResolvers::new(port)
}
