kitchen_fridge/
resource.rs1use url::Url;
2
3#[derive(Clone, Debug)]
5pub struct Resource {
6 url: Url,
7 username: String,
8 password: String,
9}
10
11impl Resource {
12 pub fn new(url: Url, username: String, password: String) -> Self {
13 Self { url, username, password }
14 }
15
16 pub fn url(&self) -> &Url { &self.url }
17 pub fn username(&self) -> &String { &self.username }
18 pub fn password(&self) -> &String { &self.password }
19
20 pub fn combine(&self, new_path: &str) -> Resource {
22 let mut built = (*self).clone();
23 built.url.set_path(&new_path);
24 built
25 }
26}