raiden/items/item.rs
1use serde_json::Value;
2
3pub trait Item {
4 /// It creates a new instance of the desired item.
5 fn new() -> Self;
6
7 /// Load the default webpage and store it.
8 /// Each call of the load function will clear the old data and override it.
9 fn load(&mut self) -> &mut Self;
10
11 /// Load `url` and store it.
12 /// Each call of the load function will clear the old data and override it.
13 fn load_from_page(&mut self, url: &str) -> &mut Self;
14
15 /// It exports the item in json format.
16 fn export(&self) -> Value;
17
18 /// Removes all existing data from the item.
19 fn clear(&mut self) -> &mut Self;
20}