pub fn depth(&self) -> Result<usize> {
        log::trace!("enter: get_depth");

        let target = self.normalize();

        let parsed = Url::parse(&target)?;
        let parts = parsed
            .path_segments()
            .ok_or_else(|| anyhow!("No path segments found"))?;

        // at least an empty string returned by the Split, meaning top-level urls
        let mut depth = 0;

        for _ in parts {
            depth += 1;
        }

        log::trace!("exit: get_depth -> {}", depth);
        Ok(depth)
    }
/// Helper function that determines the current depth of a given url
///
/// Essentially looks at the Url path and determines how many directories are present in the
/// given Url
///
/// http://localhost -> 1
/// http://localhost/ -> 1
/// http://localhost/stuff -> 2
/// ...
///
/// returns 0 on error and relative urls
Helper function that determines the current depth of a given url
Essentially looks at the Url path and determines how many directories are present in the
given Url



returns 0 on error and relative urls
Helper function that determines the current depth of a given url Essentially looks at the Url path and determines how many directories are present in the given Url returns 0 on error and relative urls
pub fn depth(&self) -> Result<usize> {
        log::trace!("enter: get_depth");
        let target = self.normalize();
        let parsed = Url::parse(&target)?;
        let parts = parsed
            .path_segments()
            .ok_or_else(|| anyhow!("No path segments found"))?;
        // at least an empty string returned by the Split, meaning top-level urls
        let mut depth = 0;
        for _ in parts {
            depth += 1;
        }
        log::trace!("exit: get_depth -> {}", depth);
        Ok(depth)
    }
pub fn depth ( & self ) -> Result < usize > { log :: trace ! ( " " ) ; let target = self . normalize ( ) ; let parsed = Url :: parse ( & target ) ? ; let parts = parsed . path_segments ( ) . ok_or_else ( | | anyhow ! ( " " ) ) ? ; // at least an empty string returned by the Split, meaning top-level urls let mut depth = 0 ; for _ in parts { depth += 1 ; } log :: trace ! ( " " depth ) ; Ok ( depth ) }
Helper function that determines the current depth of a given url
Essentially looks at the Url path and determines how many directories are present in the
given Url
Helper function that determines the current depth of a given url Essentially looks at the Url path and determines how many directories are present in the given Url
&self