pub struct InstanceRegistry {
pub instances: Vec<Instance>,
pub active: Option<String>,
}Expand description
Instance registry stored at ~/.config/modde/instances.toml
Fields§
§instances: Vec<Instance>§active: Option<String>Implementations§
Source§impl InstanceRegistry
impl InstanceRegistry
Sourcepub fn active_data_dir(&self) -> Option<&Path>
pub fn active_data_dir(&self) -> Option<&Path>
Get the active instance’s data directory.
Sourcepub fn load_from(path: &Path) -> Self
pub fn load_from(path: &Path) -> Self
Load the registry from a specific file path (for testing).
Sourcepub fn save_to(&self, path: &Path) -> Result<()>
pub fn save_to(&self, path: &Path) -> Result<()>
Save the registry to a specific file path (for testing).
Trait Implementations§
Source§impl Clone for InstanceRegistry
impl Clone for InstanceRegistry
Source§fn clone(&self) -> InstanceRegistry
fn clone(&self) -> InstanceRegistry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InstanceRegistry
impl Debug for InstanceRegistry
Source§impl Default for InstanceRegistry
impl Default for InstanceRegistry
Source§fn default() -> InstanceRegistry
fn default() -> InstanceRegistry
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for InstanceRegistry
impl<'de> Deserialize<'de> for InstanceRegistry
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 InstanceRegistry
impl RefUnwindSafe for InstanceRegistry
impl Send for InstanceRegistry
impl Sync for InstanceRegistry
impl Unpin for InstanceRegistry
impl UnsafeUnpin for InstanceRegistry
impl UnwindSafe for InstanceRegistry
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