1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
//! Generic asset resource /// Data structure representing an asset file pub struct Resource { name: String, path: String, } impl Resource { /// Constructs new resource pub fn new(name: String, path: String) -> Self { Self { name, path, } } /// Returns the [`Resource`] path pub fn path(&self) -> &String { &self.path } /// Returns the [`Resource`] name pub fn name(&self) -> &String { &self.name } }