Base protocol refactor complete
parent: tbd commit: 079d544
1 | use ; |
2 | |
3 | use ; |
4 | use Error; |
5 | |
6 | use crate GiteratedObject; |
7 | |
8 | |
9 | pub url: String, |
10 | pub public_key: String, |
11 | |
12 | |
13 | /// An instance, defined by the URL it can be reached at. |
14 | /// |
15 | /// # Textual Format |
16 | /// An instance's textual format is its URL. |
17 | /// |
18 | /// ## Examples |
19 | /// For the instance `giterated.dev`, the following [`Instance`] initialization |
20 | /// would be valid: |
21 | /// |
22 | /// ``` |
23 | /// let instance = Instance { |
24 | /// url: String::from("giterated.dev") |
25 | /// }; |
26 | /// |
27 | /// // This is correct |
28 | /// assert_eq!(Instance::from_str("giterated.dev").unwrap(), instance); |
29 | /// ``` |
30 | |
31 | |
32 | pub url: String, |
33 | |
34 | |
35 | |
36 | |
37 | "instance" |
38 | |
39 | |
40 | |
41 | Ok |
42 | |
43 | |
44 | |
45 | |
46 | |
47 | f.write_str |
48 | |
49 | |
50 | |
51 | |
52 | type Err = InstanceParseError; |
53 | |
54 | |
55 | Ok |
56 | |
57 | |
58 | |
59 | |
60 | |
61 | |
62 | InvalidFormat, |
63 | |
64 |