pub struct LocalState {
pub home: PathBuf,
pub root: PathBuf,
}Fields§
§home: PathBuf§root: PathBufImplementations§
Source§impl LocalState
impl LocalState
pub fn new(home: impl Into<PathBuf>) -> Result<Self>
Sourcepub fn discover(explicit: Option<&Path>) -> Result<Self>
pub fn discover(explicit: Option<&Path>) -> Result<Self>
Resolve explicit home, SILICON_HOME, saved config home, then normal home.
pub fn set_home(location: &Path) -> Result<Self>
pub fn initialize(&self) -> Result<()>
pub fn config(&self) -> Result<Config>
pub fn save_config(&self, config: &Config) -> Result<()>
pub fn installed(&self) -> Result<BTreeMap<String, Installed>>
pub fn save_installed(&self, items: &BTreeMap<String, Installed>) -> Result<()>
pub fn lock(&self, name: &str) -> Result<File>
Trait Implementations§
Source§impl Clone for LocalState
impl Clone for LocalState
Auto Trait Implementations§
impl Freeze for LocalState
impl RefUnwindSafe for LocalState
impl Send for LocalState
impl Sync for LocalState
impl Unpin for LocalState
impl UnsafeUnpin for LocalState
impl UnwindSafe for LocalState
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