File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,33 @@ pub type Uri {
28
28
)
29
29
}
30
30
31
+ /// Constant representing an empty URI, equivalent to "".
32
+ ///
33
+ /// ## Examples
34
+ ///
35
+ /// ```gleam
36
+ /// let uri = Uri(..Uri.empty, scheme: Some("https"), host: Some("example.com"))
37
+ /// // -> Uri(
38
+ /// // scheme: Some("https"),
39
+ /// // userinfo: None,
40
+ /// // host: Some("example.com"),
41
+ /// // port: None,
42
+ /// // path: "",
43
+ /// // query: None,
44
+ /// // fragment: None,
45
+ /// // )
46
+ /// ```
47
+ ///
48
+ pub const empty = Uri (
49
+ scheme : None ,
50
+ userinfo : None ,
51
+ host : None ,
52
+ port : None ,
53
+ path : "" ,
54
+ query : None ,
55
+ fragment : None ,
56
+ )
57
+
31
58
/// Parses a compliant URI string into the `Uri` Type.
32
59
/// If the string is not a valid URI string then an error is returned.
33
60
///
You can’t perform that action at this time.
0 commit comments