web_url/url/
path.rs

1use crate::{Path, WebUrl};
2
3impl WebUrl {
4    //! Path
5
6    /// Gets the path.
7    pub fn path(&self) -> Path<'_> {
8        unsafe { Path::new(self.path_str()) }
9    }
10
11    /// Gets the path string.
12    ///
13    /// This will be a valid path starting with a '/'.
14    fn path_str(&self) -> &str {
15        let start: usize = self.port_end as usize;
16        let end: usize = self.path_end as usize;
17        &self.url[start..end]
18    }
19}