The long awaited, exhalted huge networking stack change.
parent: tbd commit: 21b6a72
1 | use ; |
2 | |
3 | use ; |
4 | use Error; |
5 | |
6 | |
7 | |
8 | |
9 | pub use *; |
10 | use Url; |
11 | pub use *; |
12 | |
13 | use crate GiteratedObject; |
14 | |
15 | |
16 | pub url: String, |
17 | pub public_key: String, |
18 | |
19 | |
20 | /// An instance, defined by the URL it can be reached at. |
21 | /// |
22 | /// # Textual Format |
23 | /// An instance's textual format is its URL. |
24 | /// |
25 | /// ## Examples |
26 | /// For the instance `giterated.dev`, the following [`Instance`] initialization |
27 | /// would be valid: |
28 | /// |
29 | /// ``` |
30 | /// let instance = Instance { |
31 | /// url: String::from("giterated.dev") |
32 | /// }; |
33 | /// |
34 | /// // This is correct |
35 | /// assert_eq!(Instance::from_str("giterated.dev").unwrap(), instance); |
36 | /// ``` |
37 | |
38 | ; |
39 | |
40 | |
41 | |
42 | "instance" |
43 | |
44 | |
45 | |
46 | Ok |
47 | |
48 | |
49 | |
50 | self.0.clone |
51 | |
52 | |
53 | |
54 | |
55 | |
56 | f.write_str |
57 | |
58 | |
59 | |
60 | |
61 | type Err = InstanceParseError; |
62 | |
63 | |
64 | let with_protocol = format!; |
65 | |
66 | if parse .is_ok |
67 | Ok |
68 | else |
69 | Err |
70 | |
71 | |
72 | |
73 | |
74 | |
75 | |
76 | |
77 | InvalidFormat, |
78 | |
79 |