fn check_policy(&self, dst: OrigDstAddr) -> Result<AllowPolicy, DeniedUnknownPort> {
        let server = self
            .ports
            .get(&dst.port())
            .cloned()
            .map(Ok)
            .unwrap_or_else(|| match &self.default {
                Some(rx) => Ok(rx.clone()),
                None => Err(DeniedUnknownPort(dst.port())),
            })?;

        Ok(AllowPolicy { dst, server })
    }
/// Checks that the destination port is configured to allow traffic.
///
/// If the port is not explicitly configured, then the default policy is used. If the default
/// policy is `deny`, then a `DeniedUnknownPort` error is returned; otherwise an `AllowPolicy`
/// is returned that can be used to check whether the connection is permitted via
/// [`AllowPolicy::check_authorized`].
Checks that the destination port is configured to allow traffic.
If the port is not explicitly configured, then the default policy is used.
Checks that the destination port is configured to allow traffic . If the port is not explicitly configured then the default policy is used .
fn check_policy(&self, dst: OrigDstAddr) -> Result<AllowPolicy, DeniedUnknownPort> {
        let server = self
            .ports
            .get(&dst.port())
            .cloned()
            .map(Ok)
            .unwrap_or_else(|| match &self.default {
                Some(rx) => Ok(rx.clone()),
                None => Err(DeniedUnknownPort(dst.port())),
            })?;
        Ok(AllowPolicy { dst, server })
    }
fn check_policy ( & self , dst : OrigDstAddr ) -> Result < AllowPolicy , DeniedUnknownPort > { let server = self . ports . get ( & dst . port ( ) ) . cloned ( ) . map ( Ok ) . unwrap_or_else ( | | match & self . default { Some ( rx ) => Ok ( rx . clone ( ) ) , None => Err ( DeniedUnknownPort ( dst . port ( ) ) ) , } ) ? ; Ok ( AllowPolicy { dst , server } ) }
Checks that the destination port is configured to allow traffic.
Checks that the destination port is configured to allow traffic .
&self
dst
OrigDstAddr
&self
dst
OrigDstAddr