pub struct Metadata {
pub installed: InstalledInfo,
pub files: HashMap<String, String>,
pub merged: HashMap<String, HashMap<String, Vec<String>>>,
}Fields§
§installed: InstalledInfo§files: HashMap<String, String>§merged: HashMap<String, HashMap<String, Vec<String>>>Tracks merged JSON entries per profile: profile_name -> file_path -> [json_paths]
Implementations§
Source§impl Metadata
impl Metadata
pub fn new(base_dir: &Path) -> Self
pub fn load(target: &Path) -> Result<Option<Self>>
pub fn save(&self, target: &Path) -> Result<()>
pub fn add_profile(&mut self, name: &str)
pub fn remove_profile(&mut self, name: &str)
pub fn add_file(&mut self, path: &str, hash: &str)
pub fn remove_file(&mut self, path: &str)
pub fn get_file_hash(&self, path: &str) -> Option<&String>
Sourcepub fn add_merged(
&mut self,
profile: &str,
file_path: &str,
json_paths: Vec<String>,
)
pub fn add_merged( &mut self, profile: &str, file_path: &str, json_paths: Vec<String>, )
Record merged JSON paths for a profile
Sourcepub fn get_merged(&self, profile: &str, file_path: &str) -> Option<&Vec<String>>
pub fn get_merged(&self, profile: &str, file_path: &str) -> Option<&Vec<String>>
Get merged JSON paths for a profile and file
Sourcepub fn get_merged_files(
&self,
profile: &str,
) -> Option<&HashMap<String, Vec<String>>>
pub fn get_merged_files( &self, profile: &str, ) -> Option<&HashMap<String, Vec<String>>>
Get all merged files for a profile
Sourcepub fn remove_merged(&mut self, profile: &str)
pub fn remove_merged(&mut self, profile: &str)
Remove all merged entries for a profile
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Metadata
impl<'de> Deserialize<'de> for Metadata
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Metadata
impl RefUnwindSafe for Metadata
impl Send for Metadata
impl Sync for Metadata
impl Unpin for Metadata
impl UnwindSafe for Metadata
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more