1use address::IPAddress;
2
3#[derive(Clone, Debug)]
12pub struct WebUrl {
13 pub(in crate::url) url: String,
14 pub(in crate::url) scheme_len: u32,
15 pub(in crate::url) host_end: u32,
16 pub(in crate::url) ip: Option<IPAddress>,
17 pub(in crate::url) port_end: u32,
18 pub(in crate::url) port: Option<u16>,
19 pub(in crate::url) path_end: u32,
20 pub(in crate::url) query_end: u32,
21}
22
23impl WebUrl {
24 #[allow(clippy::too_many_arguments)]
31 pub unsafe fn new<S>(
32 url: S,
33 scheme_len: u32,
34 host_end: u32,
35 ip: Option<IPAddress>,
36 port_end: u32,
37 port: Option<u16>,
38 path_end: u32,
39 query_end: u32,
40 ) -> Self
41 where
42 S: Into<String>,
43 {
44 Self {
45 url: url.into(),
46 scheme_len,
47 host_end,
48 ip,
49 port_end,
50 port,
51 path_end,
52 query_end,
53 }
54 }
55}
56
57impl WebUrl {
58 pub fn len(&self) -> usize {
62 self.url.len()
63 }
64
65 pub fn is_empty(&self) -> bool {
67 false
68 }
69}